-CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

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
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

-CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

Post by josephaaroncampbell »

Hello,

I am using -clut to apply edits to grayscale , 8bit , '.tif' images produced via Capture One Pro 9.

How i produce the CLUT image:

Code: Select all

magick convert -colorspace LAB -channel R -separate -size 1x256 gradient: -rotate 90 clut.tif
How I apply the CLUT image:

Code: Select all

magick convert -quiet CO_IMAGE.tif CLUT.tif -clut -colorspace gray output.tif
(there are adjustments made to the clut tiff image in my workflow , like -level and -gamma, but this still happens without those)

However. The output tiff is solarized. which looks inverted but is not.

Here is the strange part.

If i take the '.tif' image and resave it using Adobe Photoshop CC.....Then -clut works just fine. It does not solarize the image

So i am curious what i am misunderstand about the -clut operation or what is the difference between a '.tif' image from Capture One Pro 9 and Adobe Photoshop?

Here is a link to example full resolution tiff image files:

https://chicagohistory.box.com/v/IM-CLUT

There are three files :
1. XXXXXX_CO-CLUT -> image created using capture one pro, then processed with IM using the -clut operator

2. XXXXXX_CO -> the tiff image straight from Capture One Pro. No adjustments or changes.

3. XXXXXX_PShop-CLUT -> the tiff image from Capture One Pro, opened and re-saved using Adobe Photoshop, then processed with IM using the -clut operator.
Any idea why a tiff from Adobe Photoshop works but Capture One pro doesn't?

I have some thoughts but would appreciate your input.

Thank You.

Windows 7 x64

Version: ImageMagick 7.0.3-2 Q16 x64 2016-10-02 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

Post by fmw42 »

Not sure I can answer your issue, but your syntax is wrong. First you are using legacy convert via IM 7 magick. Second, the proper syntax for raster images is to read the input (or create it first), then define the settings, then apply the corresponding operators then write the output. So your commmand
magick convert -colorspace LAB -channel R -separate -size 1x256 gradient: -rotate 90 clut.tif
should properly be

Code: Select all

magick -size 1x256 gradient: -colorspace LAB -channel R -separate +channel -rotate 90 clut.tif
Also you have
magick convert -quiet CO_IMAGE.tif CLUT.tif -clut -colorspace gray output.tif
why do you need -colorspace gray -- is your input not grayscale. If it is not, then you may want to put -colorspace gray before the -clut.

It might help us to know exactly what processing you used for one full example.

If I do:

Code: Select all

magick -size 1x256 gradient: -colorspace LAB -channel R -separate +channel -rotate 90 clut.tif

Code: Select all

magick i150935_CO.tif clut.tif -clut result.png
I see no solarizing using IM 7.0.5.0 Q16 Mac OSX. It fact, since you have a gradient, there is little change between the input and clut result. The change is only due to the lab colorspace shift of the gradient.

Are your libtif and libpng up-to-date?
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

Re: -CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

Post by josephaaroncampbell »

Ok. Thanks for correcting my syntax. I will have to try this out and see if my grammar is the issue.
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

Re: -CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

Post by josephaaroncampbell »

Figured it out.

Thanks for your help fmw42. If i remove the legacy convert call then there is no issue. so that legacy command was doing something different.

Its interesting still that the legacy convert command did not have issues with the tiff from adobe photoshop.

The full usage of the CLUT in my batch file looks like this with just removing the convert command:

Code: Select all

magick  -colorspace LAB -channel R -separate -size 1x256 gradient: -rotate 90 gscale.tif

magick -quiet gscale.tif -colorspace gray -gamma !gNum! -sigmoidal-contrast !lNum!x!sNum!%% -level !lMin2!%%x!lMax2!%% clut.tif
 
magick -quiet input.tif clut.tif -clut output.tif
 
This is without following your advice for the syntax completely just yet. which i need to review for myself since i usually have syntax errors and will have to update accordingly when i have the chance. I usually do things in a way that helps me understand the order of things, which can be redundant or incorrect sometimes. So i appreciate the guidance. its helping me improve. 8)

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

Re: -CLUT solarizes tiff image from Capture One Pro but not with a tiff image from Photoshop?

Post by fmw42 »

See http://www.imagemagick.org/Usage/basics/#why.

IM 6 is usually more forgiving than IM 7. It seems to be the reverse here for some reason, though I expect if you use proper IM syntax with magick, it will also work correctly.

Settings and subsequent operators for raster images always come after reading the raster image. Some settings for vector images often need to come before reading the vector (PDF, EPS, etc), since they have no pixel dimension, so you have to give them -density values when converting them to raster images. -colorspace sRGB is another than needs to come before reading a CMYK vector file when converting, though one can convert using profiles specified after reading the input vector file and that is usually more accurate.
Post Reply