Paid: Image difference

Do you need consulting from ImageMagick experts and are willing to pay for their expertise? Or are you well versed in ImageMagick and offer paid consulting? If so, post here otherwise post elsewhere for free assistance.
Post Reply
dave5
Posts: 4
Joined: 2019-12-05T11:13:41-07:00
Authentication code: 1152

Paid: Image difference

Post by dave5 »

Hi

I currently have an image difference script which I hacked together. The result is ok, but it needs improvement from a professional.

The work is focused on line based images. Bash scripts or ruby are fine. Currently: ImageMagick 7, Ubuntu 16.04. Happy to upgrade if needed.

Cheers

Dave

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Paid: Image difference

Post by fmw42 »

Please post more information or examples of your process. Also identify what kind of improvement you desire.

dave5
Posts: 4
Joined: 2019-12-05T11:13:41-07:00
Authentication code: 1152

Re: Paid: Image difference

Post by dave5 »

Problems with the current process:
  • produces "feathered" results (see images)
  • ghosting of the source images in the difference images. The ghosting is of data that is the same.
  • is very dependent on the size of the two images being the same size and location
At the least I want the generate images to be sharper and the ghosting removed (primary task) and I would like the script to be able to register the two images correctly (secondary).

I know there are limits to dealing with bitmaps, but I do need help tuning things up.

Image
Image

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Paid: Image difference

Post by fmw42 »

Can you post your input images and the command you used? What was the exact version of Imagemagick 7 that you used -- what do you get from

Code: Select all

magick -version

dave5
Posts: 4
Joined: 2019-12-05T11:13:41-07:00
Authentication code: 1152

Re: Paid: Image difference

Post by dave5 »

Here are the input images:

before: https://static.omniblox.io/images/examples/before.png
after: https://static.omniblox.io/images/examples/after.png

i have a lot of control over the input images, so if there is pre-processing that i can do to improve the result, then i can do that. it must also be noted that it is highly likely that the input images will be color in some cases and this would need to be handled (my work kinda deals with it, but i suspect that my current approach is the cause of the ghosting).

Code: Select all

~$ magick -version
Version: ImageMagick 7.0.8-35 Q16 x86_64 2019-04-08 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP 
Delegates (built-in): jbig jng jpeg lzma png tiff zlib
Commands wise i use a series of -compose calls. Am happy to pay for the initial review work even if the result is "hmmm... can't think of another way of doing it".

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Paid: Image difference

Post by fmw42 »

What command are you using to get the differences?

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Paid: Image difference

Post by fmw42 »

Your issue is in your drawing of your lines, especially on the curve. It has slight aliasing from pure white around it.

Code: Select all

magick compare -metric rmse -highlight-color red -colorspace sRGB before.png after.png before_after_diff.png
Image

You can do a white-threshold about 50% and get rid of the aliasing. (Note that -white-threshold is not currently allowed inside a compare command, so I have to do it first with magick and pipe the results to magick compare

Code: Select all

magick before.png after.png -white-threshold 55% miff:- | magick compare -metric rmse -highlight-color red -colorspace sRGB - before_after_diff2.png
Image

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Paid: Image difference

Post by fmw42 »

Is this what you want?

Code: Select all

magick before.png after.png \
-threshold 55% \
-compose minus -composite \
-write mpr:mask \
+level-colors black,red \
mpr:mask \
-alpha off -compose copy_opacity -composite \
before_diff.png
Image

Code: Select all

magick after.png before.png \
-threshold 55% \
-compose minus -composite \
-write mpr:mask \
+level-colors black,blue \
mpr:mask \
-alpha off -compose copy_opacity -composite \
after_diff.png
Image

dave5
Posts: 4
Joined: 2019-12-05T11:13:41-07:00
Authentication code: 1152

Re: Paid: Image difference

Post by dave5 »

That should work a treat! Thank you.

Post Reply