Match altered image to its original - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: Match altered image to its original (/Thread-Match-altered-image-to-its-original) Pages:
1
2
|
Match altered image to its original - Brian.Raila - 10-30-2021 Objective is to match an image altered by an uncontrollable process, to a variant which will, when run through that same process, appear the same as in its original, unprocessed form. I have reviewed numerous posts, tutorials, etc., but remain stumped.
Attached '2 Hall Ghosted.png' indicates the "ghosting" which is beyond my control. I seek to create an image, 'Hall Original - Prepped for Ghosting', which will come out the other end appearing identical to the pre-processed original. Attached '9 Image A - Gray of RGBs 119 on L, Ghosted to RGBs 137 on R' was successfully addressed by setting Image A to Brightness -34 [resulting in RGBs of 103]. Post-process, it measures all 119s. However, the ghost processor is provably not simply linear, across all channels, as seen in the more complex Hall image, as it is not similarly remedied by simply a Brightness reduction. (If twiddling only Brightness, approximate matches are: Stage -6, Back wall -12, Center red carpet -33.) I am aware of Color Curves, Channels, and such, but fully inexpert in their application. [Disclaimer: I'm aware of spatial distortions regarding slight scaling/proportionality differences in the examples. That is easily remedied by a more careful workflow that shall be employed. Not to worry.] ..... I see I hit the 5-file Upload Limit. Shall send specimens 6 - 9 in followup to this Post ..... Prompt replies would be most gratefully welcomed. Thanks, BR Find here attached, specimens 6 - 9 mentioned in my original Post. – BR RE: Match altered image to its original - rich2005 - 10-30-2021 Looks like jpeg compression artefacts to me. Does export as jpeg feature in your original workflow ? Edit: maybe not jpeg compression, maybe some smoothing ? I can see parts of after version have vanished. I did try a before-after CLUT using the gmic plugin without success. RE: Match altered image to its original - Ofnuts - 10-30-2021 If (and only if) the process is altering the pixels individually (ie, not using data from adjacent pixels like it's done when sharpening), then you can feed the process an image with 16 mega-pixels, each pixel being a different RGB triplet, and the output will be a "CLUT" (Color Lookup Table). In the general case, all you can then do is invert the CLUT, Note that you can discover than some input RGB values produce the same RGB output (in particular if the process clips a channel) and that some RGB output values cannot be achieved (because there is always some color loss in such processes). Then, if you are lucky you can discover that the mapping of the R (or G or B) values to output values doesn't depend on the other channels on the same pixel (ie, a Red 200 becomes a Red 220, whether it is in a light gray (200,200,200), strong red (200,0,0), yellow (200,200,0) . In which case you can indeed use Curves to obtain a per-channel mapping. If you aren't, then you can see if the same would be true in the HSV, HSL, LCH, or Lab models and perhaps be able to emulate the same thing with Gimp. But in any case, if you want an accurate result, you won't be using Gimp alone, you will need some data exploration tools. RE: Match altered image to its original - Brian.Raila - 10-30-2021 Wonderful to hear from both of you, familiar names. And so promptly. (My email notification was lagging.) I have been trying to upload an attachment image, '10 Original JPEG converted to '1 Hall Original' PNG', as to Rich2005's question. It's a jpeg of size <500K, so go figure. Have tried more than one browser. I'm geting: Bad Request Your browser sent a request that this server could not understand. – – – I'll keep at it. Separately, perhaps I ought to upload the previous specimens in their .xcf form. I'll have to knock down their sizes. Ofnuts - would those shed light on the LUTs? I know it comes up, here –– any suggestion of an outside-the-forum upload repository, to make sharing examples easier ? RE: Match altered image to its original - PixLab - 10-31-2021 (10-30-2021, 08:12 PM)Brian.Raila Wrote: I know it comes up, here –– any suggestion of an outside-the-forum upload repository, to make sharing examples easier ? No real preferences, I was using wetransfer but they now ask for an email even to get just a link, imgur start to block some countries from 2 weeks or so, like the country I am actually living in, so I would not recommend it, and it become even worse as from few days now, they also start to block the different free proxies I was using recently to see screenshots on GF (thus I can't see anymore @rich2005's videos ) I did found (and test) those 2, which don't trade your upload with your email https://www.filedropper.com/ up to 5GB https://transfer.sh/ ?10GB RE: Match altered image to its original - Brian.Raila - 10-31-2021 The original JPEG, along with the full set of previous attachments, as well as the XCFs from which they were exported, are available to all at this link. Hoping to gain some competence in this realm. Many thanks, BR RE: Match altered image to its original - rich2005 - 10-31-2021 Probably not possible with those images (nothing is ever definite) I can get a better match with the main areas of colour but the 'fringe' 'ghosted' (would be antialiased) pixels defeats the plugins. 1. Look Up Table: The gmic plugin http://www.gmic.eu has two filters CLUT from before-after and Apply external CLUT Make a difference CLUT and apply to one to hopefully get back to the other. [attachment=6955] The attached .xcf has 3 layers to compare the clut applied - 1.orig - 2 ghosted 2. Color curve matching: 2 plugins a compiled plugin http://elsamuko.github.io/gimp-elsamuko/plugins/get-curves and a python plugin https://www.gimplearn.net/viewtopic.php/Get-applied-RGB-Curves-Script-for-GIMP?f=3&t=1447 both get sort of a color match 2-ghosted.png is lighter that 1. png and gives the darker colours. The split view not so easy to see the difference but it is there. elsamuko [attachment=6952] gimplearn [attachment=6953] One problem is, these plugins sample 8 bit images and the curve is an approximation. A couple of odd things about the images the embedded 'gimp sRGB' profiles and The original jpg is a different scale to the cropped pngs. RE: Match altered image to its original - Ofnuts - 10-31-2021 If you look at the histograms of the before/after pictures, you find in both the same bumps in the color channels, with roughly the same shapes. So you can match the bump between the two, and with the histogram you can find the value of the bumps (using the little handles at the bottom). For instance, in the Red channel the three bumps at 82, 207, 243 are matched by three bumps at 100, 217, 246. [attachment=6956]
So if you want to compensate for the shift in the process, you change the colors of your input image to have the colors that will give them their initial color after your processing. For instance, a Red channel at 100 in the input image, should be darkened to 82 so that the process puts it back to 100. In other words, you use Curves where the inputs are the values in the "after" image and the outputs are the values in the before image. In the Curves tool, this means selecting the red channel, clicking on the diagonal, and dragging to put your point at Input=100,Output=82. This creates a smooth curve with its ends still in the corners at (0,0) and (255,255)). By a total coincidence, the points at (217,207) and (246,243) are on that curve. If you do the same for Blue, you'll find the same coincidence (start with the value closest to middle) [attachment=6957]
Caveats:
RE: Match altered image to its original - Brian.Raila - 10-31-2021 This is wonderful, fellows ! As to your correctly noted "different scales", and "total coincidence", and absence of "hair combing" –
– – – In the meantime, I'll be examining your replies in detail, and upping my Gimp Game [histogram analysis, channel manipulation, multi-window views, etc.] RE: Match altered image to its original - Ofnuts - 11-01-2021 This is very odd. There are 32 regularly spaced (step=8) peaks in the output histogram (that are the same on all channels). IS the image quantized in the process? If so, forget it, no way you are going to get a proper image after compensation. That would be a bit like transforming a cow so that it eventually comes out alive from the meat grinder. [attachment=6964]
|