Page 1 of 1

Substituing a profile in a jpeg file

Posted: 2007-06-28T08:15:38-07:00
by dargaud
Hello all,
I thought I'd asked this before but I can't find trace of it. How do you substitute a profile
in a JPG file without touching the bits ?

If I do:

Code: Select all

convert -verbose -profile $AdobeICC Source.jpg -profile $AdobeICC Dest.jpg
The file gets recompressed

The reason I want to do that is that my files contain AdobeRGB profiles that
are not recognized by some apps. I want to substitute with another similar
profile that _is_ recognised, without changing anything else (exif info,
bits...). Maybe something like mogrify would be better suited but I got the same kind of recompression.

Thanks

Re: Substituing a profile in a jpeg file

Posted: 2007-06-28T17:09:06-07:00
by anthony
IM can NOT do this. IM is a general raster image processor, for modifying images.
It is not a specific JPEG lossless processor. Its functions for profiles are more about using them while modifying the image in some way (resizing, distorting, color modifying, etc etc etc).

There are however lots of programs that can interact with JPG images losslessly. Starting with lowlevel jpegtrans, through to jhead (which restores profiles that jpegtrans junks) and so on. I suggest you look at those.

See //www.imagemagick.org/Usage/formats/#jpg
I also updated this section but it may two a couple of days to appear on the main site.

Re: Substituing a profile in a jpeg file

Posted: 2007-06-29T02:00:47-07:00
by dargaud
Thank you, at least that's clear.

I didn't know you could manipulate profiles with jhead... I see nothing about that in its doc.

And isn't jpegtrans outdated ? I remember using it for lossless rotations but I can hardly find a working link to the code...

Re: Substituing a profile in a jpeg file

Posted: 2007-06-29T04:51:22-07:00
by anthony
jpegtrans is the primary lossless transformer. It comes with the JPEG libraries, so it is probably on the system. jhead even uses it. But it does not handle profiles well, which is one function jhead does manage in its calls to jpegtrans.