Hi,
and thanks for all your comments.
fmw42 wrote:convert input.tiff -colorspace LAB <do something> -colorspace sRGB output.jpg
convert input.tiff -colorspace sRGB output.jpg
The former should work fine.
Unfortunately, it doesn't -- when calling something like
Code: Select all
convert input.tiff -colorspace LAB -level 1%,99% -colorspace sRGB output.jpg
the output image's colors dont' look right, they are way too pale. The same holds true for
Code: Select all
convert input.tiff -colorspace sRGB -level 1%,99% -colorspace sRGB output.jpg
(I know, the second application of -colorspace sRGB is unnecessary, but I just wanted the second command to have the same basic structure as the first one.)
I only get the colors right when explicitly applying an sRGB ICC file:
Code: Select all
convert input.tiff -level 1%,99% -profile sRGB.icc output.jpg
(works with and without further manipulaion like the -level operation)
By the way, even
fmw42 wrote:
convert input.tiff -colorspace sRGB output.jpg
The latter is a noop if your input tif is sRGB.
should -- in my case -- not be a no-op since the input TIFFs are in ProPhoto RGB (with the profile embedded, as mentioned in my initial posting). IM, however, seems to think that the input images are in sRGB already (16 bit, though) -- in spite of the embedded profile:
Code: Select all
identify input.tiff
=> input.tiff TIFF 6768x4416 6768x4416+0+0 16-bit sRGB 179.4MB 0.000u 0:00.019
fmw42 wrote:
Perhaps post a link to your input.tiff, so we can see what you are trying to do along with your command line for actually processing your file.
An example input TIFF will soon be available from
http://www.tcrass.de/files/input.tiff (currently uploading 185 MB; beware, the TIFF does contain a thumbnail, which I couldn't get rid of without losing the profile embedded in the main image, so use -delete 1 when reproducing the above commands), and the combined (and down-scaled) results of the above three commands can be found at
http://www.tcrass.de/files/combined.jpg
snibgo wrote:
1. An image that is converted to another colorspace, whether using "-colorspace" or "-profile", will look the same. Changing colorspace shouldn't change the appearance. This is because an image viewer should convert the image to sRGB before displaying it. (Some professional equipment uses other colorspaces, but conventional computers are sRGB.)
Yeah, that seems to depend very much on the viewing application used -- DigiKam and Krita apparently get it right, while Dolphin and GwenView seem to ignore the ProPhoto RGB profile embedded in the TIFFs.
snibgo wrote:
Converting to another colorspace does two things: it changes pixel values, and writes metadata that says what the new colorspace is. However, some software ignores the metadata and asumes the image is sRGB.
I really start to suspect that even IM sometimes does ignore the embedded profile information, at least when working with the -colorpace operator -- otherwise I don't know how to explain the observation that pixel values apparently don't get properly adjusted when trying to convert the ProPhoto RGB input.tiff into sRGB output.jpeg using -colorspace sRGB. (Well, they of course must be ajusted in the sence that they have to be converted from 16 to 8 bit, but it seems they get just linearly scaled down to fit into 8 bits, i.e. divided by 256.) And the above mentioned observation that the IM identify command outputs sRGB for the ProPhoto RGB TIFFs further supports this suspicion.
snibgo wrote:
2. Profiles are mostly used for device-specific fine-tuning. A given model of printer, with particular inks and paper, will use a particular profile. There are also many generic profiles, such as for web offset printing on coated or uncoated paper. If you are preparing images for commercial printing, you might work in the relevant colorspace, with the correct profile. This is tricky as the computer screen can show colours that the printer can't print, and vice versa.
I guess you're right about what profiles are mostly used for, but in principle *any* color space conversion can be described as the application of profiles, can't they? I mean, it should make no difference if IM used one of its built-in conversion equations (as described e.g. at
http://www.imagemagick.org/script/comma ... ptions.php, like so:
Code: Select all
pixel values in LAB color space ==[IM's internal LAB to sRGB conversion equations]==> pixel values in sRGB color space
) or two profiles describing the LAB and the sRGB color space, respectively:
Code: Select all
pixel values in LAB color space ==[LAB profile]==> pixel values in the PCS ==[sRGB profile]==> pixel values in sRGB color space
snibgo wrote:
3. "-colorspace" is a different mathematical description of colours. Imagine 3 dimensions of a cube. Every colour is within the cube. The dimensions might be red green and blue, or hue saturation and value, or L* a* and b*. Each method of description has its own advantages and disadvantages.
Does this go down the same line as "RGB, CMY, HSL are color systems, not color spaces" (or similar), a senctence I read somewhere on the (btw: phantastic!) IM usage pages? To me it seems that describing colors by their red, green and blue (or cyan, magenta and yello) component or by their hue, saturation and light/brightness etc. is more about finding human-comprehensible terms -- in the end, all these systems describe colors as three-component vectors, and the exact mapping of such vectors to "real" colors requires the application of conversion functions as provided by color profiles.
Anyway, back to IM and the parallel existance of -colorspace and -profile: To me it seems that both identfy and convert's -colorspace operator ignore embedded profile information and only rely on IM-internal concepts of color spaces (or color systems) and corresponding conversion functions. On the other hand, -profile seems to work independently from -colorspace (although I haven't thoroughly tested this yet). So for colorspace conversion one should use either the one or the other, but not both, right? (Of course except you know exactly what you do
Regards --
Torsten