remove colour profile without distortion

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
arand
Posts: 10
Joined: 2011-03-24T13:54:36-07:00
Authentication code: 8675308

remove colour profile without distortion

Post by arand »

I am trying to replace/remove colour profiles in a set of images that have a HP copyright embedded in them (default photoshop stuff I guess).

I have tested to do this with GIMP, at it seems to manage to apply just a general colour profile without changing the image (pixel perfect).

However when I run convert -strip with imagemagick and then compare the result to the original it is clearly different.

These are rather basic images, one example is this:
Image
(Image itself is Copyright "appleflap" CC-BY-SA)

Am I doing things wrong?
Is there any way to do this with imagemagick and better retain the original image?

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

Re: remove colour profile without distortion

Post by fmw42 »

try putting back just the sRGB.icc profile after -strip. It works fine for me on IM 6.6.8.6 Q16 Mac OSX Tiger.

convert dangernm.jpg -strip -profile Profiles/sRGB.icc dangernm_strip_sRGB.jpg
arand
Posts: 10
Joined: 2011-03-24T13:54:36-07:00
Authentication code: 8675308

Re: remove colour profile without distortion

Post by arand »

Hmm, that still does not produce a pixel-perfect result like gimp's.
But it seems that my problem lies in fact that a simple

Code: Select all

convert danger_nm.jpg danger_nm_im.jpg
Does not produce a clone, but a slightly altered version.
Even if -quality 100 is used there are a few pixels not matching the original, isn't this supposed to be lossless?
Does your version output a pixel-perfect copy on a simple convert, if so, what version are you running? (debian 8:6.6.0.4-3 on my side)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: remove colour profile without distortion

Post by fmw42 »

jpg is a lossy format even at -quality 100. you need to use some lossless format (png, jp2, etc). I have no idea what GIMP is doing to get around that if it is using jpg for output. Try jp2 (jpeg2000 with the Jasper delegate)

I was using IM 6.6.8.6 Q16 Mac OSX Tiger.
Post Reply