Page 1 of 1

Filters reverse engineering

Posted: 2014-03-04T03:58:15-07:00
by debug
Hello,

I'm looking for somebody who will help me to do the reverse engineering for the filters applied to the following images:

Image
Image

Image
Image

Image
Image

Image
Image

Image
Image

Thanks.

Re: Filters reverse engineering

Posted: 2014-03-04T04:11:41-07:00
by snibgo
The main effects are crop and resize, obviously.

Other effects are more subtle, and are masked by jpeg compression. There may be unsharpening. The building may have tonal expansion. The clapping woman has colour shift, or perhaps just increased saturation. The final image has some smoothing.

Re: Filters reverse engineering

Posted: 2014-03-04T04:39:31-07:00
by debug
snibgo wrote:The main effects are crop and resize, obviously.

Other effects are more subtle, and are masked by jpeg compression. There may be unsharpening. The building may have tonal expansion. The clapping woman has colour shift, or perhaps just increased saturation. The final image has some smoothing.
Yes crop/resize are main effects, but more interesting for me are the colors, contrast, levels correction and some blur / smoothing / unsharpening. All of these images were processed by same script (that I believe based on histogram analysis and correction).


P.S I'm ready to pay 500 usd by paypal to everyone who will help me to create the full automatic script with same results.

Re: Filters reverse engineering

Posted: 2014-03-04T11:53:49-07:00
by fmw42
Do you have access to the source code for the script? What platform and what version of IM are you using?

I tried this on the first image and it looks close. You can adjust the -contrast-stretch arguments if you want and the unsharp masking.

Code: Select all

convert 1_orig.jpg -contrast-stretch 0.1% -resize 240x180 -unsharp 0x1 1_proc.jpg

Re: Filters reverse engineering

Posted: 2014-03-04T12:01:19-07:00
by debug
fmw42 wrote:Do you have access to the source code for the script? What platform and what version of IM are you using?

Unfortunately, I don't have it, i can only see the results of this script.
If I had a source code, my question wouldn't be posted here :)

Version: ImageMagick 6.7.0-10 2011-07-31 Q16, Linux or FreeBSD

Re: Filters reverse engineering

Posted: 2014-03-04T12:03:21-07:00
by fmw42
Version: ImageMagick 6.7.0-10 2011-07-31 Q16
What platform? Linux/Mac/Windows? If on windows, you may need to use %% rather than %

Test my command and see if that is close?

Re: Filters reverse engineering

Posted: 2014-03-04T12:13:26-07:00
by debug
fmw42 wrote:
Version: ImageMagick 6.7.0-10 2011-07-31 Q16
What platform? Linux/Mac/Windows? If on windows, you may need to use %% rather than %

Test my command and see if that is close?
Linux

Re: Filters reverse engineering

Posted: 2014-03-04T12:18:03-07:00
by debug
I've tried it now, it works, but not for all.

Example

My result
Image

Original result
Image

Re: Filters reverse engineering

Posted: 2014-03-04T12:50:07-07:00
by fmw42
try this and adjust the contrast-stretch a bit more when needed

Code: Select all

convert 1_orig.jpg -auto-level -auto-gamma -contrast-stretch 0.1% -resize 240x180 -unsharp 0x1 1_proc3.jpg
or

Code: Select all

convert 1_orig.jpg -equalize -auto-level -auto-gamma -resize 240x180 -unsharp 0x1 1_proc4.jpg
or this with no contrast stretch

Code: Select all

convert 1_orig.jpg -auto-level -auto-gamma -resize 240x180 -unsharp 0x1 1_proc5.jpg

Re: Filters reverse engineering

Posted: 2014-03-05T02:14:13-07:00
by debug
fmw42 wrote:try this and adjust the contrast-stretch a bit more when needed
Thank you for your answers.

1. The main problem is to understand when more contrast-stretch is needed automatically for bulk processing.
2. I have tried all of the codes from your previous message, the original result is better.
3. In addition, I see on the original result some blur /smoothing filter applied. You can see it if you pay attention to the skin of the lady or the trees on the 1_res.jpg.


Original result
Image

Code: Select all

convert 7_orig.jpg -contrast-stretch 0.1% -resize 240x180 -unsharp 0x1 7_proc.jpg
Image

Code: Select all

convert 7_orig.jpg -auto-level -auto-gamma -contrast-stretch 0.1% -resize 240x180 -unsharp 0x1 7_proc3.jpg
Image

Code: Select all

convert 7_orig.jpg -equalize -auto-level -auto-gamma -resize 240x180 -unsharp 0x1 7_proc4.jpg
Image

Code: Select all

convert 7_orig.jpg -auto-level -auto-gamma -resize 240x180 -unsharp 0x1 7_proc5.jpg
Image

Re: Filters reverse engineering

Posted: 2014-03-05T02:47:12-07:00
by snibgo
For the smoothing, I think this is close, for all the images. Windows script. The two commands could be combined into one. If further experiments show that the two blur amounts 0x2 are correct, it would need doing only once.

Code: Select all

convert ^
  %1_orig.jpg ^
  ( +clone -blur 0x2 ) ^
  -compose Difference -composite ^
  -grayscale RMS ^
  -auto-level ^
  -auto-gamma ^
  -blur 0x20 ^
  -contrast-stretch 25x25%% ^
  -negate ^
  mask.png

convert ^
  %1_orig.jpg ^
  ( +clone -blur 0x2 ) ^
  mask.png ^
  -composite ^
  %1_masked.png

Re: Filters reverse engineering

Posted: 2014-03-05T03:01:24-07:00
by debug
snibgo wrote:For the smoothing, I think this is close, for all the images. Windows script. The two commands could be combined into one. If further experiments show that the two blur amounts 0x2 are correct, it would need doing only once.
I get the following error on Windows

Z:\work\imagemagick>convert 1_orig.jpg ( +clone -blur 0x2 ) -compose Diffe
rence -composite -grayscale RMS -auto-level -auto-gamma -blur 0x20 -co
ntrast-stretch 25x25% -negate mask.png
convert.exe: unrecognized option `-grayscale' @ error/convert.c/ConvertImageComm
and/1626.


Z:\work\imagemagick>convert 1_orig.jpg ( +clone -blur 0x2 ) mask.png -co
mposite 1_masked.png
convert.exe: unable to open image `mask.png': No such file or directory @ error/
blob.c/OpenBlob/2614.
convert.exe: unable to open file `mask.png' @ error/png.c/ReadPNGImage/3641.

Z:\work\imagemagick>

Re: Filters reverse engineering

Posted: 2014-03-05T03:37:03-07:00
by snibgo
You are using v6.7.0, a very old version, before "-greyscale RMS" was available. I suggest you upgrade.

Re: Filters reverse engineering

Posted: 2014-03-05T04:32:33-07:00
by debug
I have applied the script, but it seems that there are something different was used.

Source 1

Image
Masked
Image

Original Result
Image

Source 7
Image

Masked
Image

Original Result
Image