Montage - Colorspace Questions

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?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

olafkarsten wrote:1: (255,127,127) #FFFFFF cielab(255,127,127)
No. #FFFFFF isn't 255,127,127.
olafkarsten wrote:These printers use LAB colorspace and they know exactly what white is.
So ask your printers, and use that value.
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

snibgo wrote:
olafkarsten wrote:1: (255,127,127) #FFFFFF cielab(255,127,127)
No. #FFFFFF isn't 255,127,127.
Whatever the correct numbers are. It should be pure white, but it is not.
snibgo wrote:
olafkarsten wrote:These printers use LAB colorspace and they know exactly what white is.
So ask your printers, and use that value.
Sounds somewhat angry. :( With the printers (I meant the machine) should be a joke.

I think the resulting image from Imagemagick should be in pure white. But it does not. If I convert a white srgb pixel in cielab - I did not get a white pixel. Thats my point. And I'm somewhat lost.

1: (255,128,127) #FF807F cielab(255,128,127) -> is not white. Or did i miss something?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage - Colorspace Questions

Post by fmw42 »

Proper values can be computed at http://www.brucelindbloom.com/index.htm ... lator.html

which shows that LAB=100%,0%,0% corresponds to white in RGB.


try this

convert xc:white -colorspace LAB txt:
# ImageMagick pixel enumeration: 1,1,65535,cielab
0,0: (99.9985%,0.0030518%,-0.00762951%) #FFFE00020000 cielab(99.9985%,0.0030518%,-0.00762951%)

which is within computation accuracy of 100%,0%,0% as expected.

Note that LAB values for A and B can be negative

For example RGB=128,255,64 gives LAB=90.2302,-59.8291,73.3072

IM biases them by 50%, since without HDRI all the negatives would be clipped to 0

convert xc:white -colorspace LAB -format "%[pixel:u.p{0,0}]" info:
srgb(99.9985%,50.0038%,49.9931%)

This may be a bug?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

The calculator at http://www.brucelindbloom.com/index.htm ... lator.html takes the central value of the a* and b* channels as 0, with values being positive or negative. In current IM, the central values are 50%, not zero.

In Lab space, the triplet (x,50%,50%), using the IM convention, is a neutral colour from black, through grey to white.

Therefore white in IM's Lab space is (100%,50%,50%).

Code: Select all

convert xc:srgb(100%,100%,100%) -colorspace Lab -set colorspace sRGB -depth 16 txt:

# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (99.9985%,50.0038%,49.9931%)  #FFFE80027FFB  srgb(99.9985%,50.0038%,49.9931%)
There is some rounding error. 100/65536 = 0.0015259, so the error in the b* channel is larger than I would like.

Printer inks are generally cyan, magenta, yellow and black, possibly with other inks such as light magenta etc. A printer that accepts other colourspaces such as sRGB or Lab will translate as required. There will be a profile (or equivalent) within the software chain to the printer.

Software implementation of Lab isn't perfectly defined, and perhaps this printer does something weird. The documentation should say.
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

Okay, thanks. I will try to get someone who knows something about the printers. I 'll come back, if I have a solution or another questions. Thanks so far.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

olafkarsten wrote:I think the resulting image from Imagemagick should be in pure white. But it does not. If I convert a white srgb pixel in cielab - I did not get a white pixel.
What colour do you get? If it is close to white, then the problem is probably in the profile (or equivalent). Perhaps it isn't correctly set for the paper or ink, or the intent is wrong.

If the colour is very different, eg bright red, then there is a bigger problem. Also check that the printer is functioning correctly, eg the heads aren't clogged.
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

snibgo wrote:The calculator at http://www.brucelindbloom.com/index.htm ... lator.html takes the central value of the a* and b* channels as 0, with values being positive or negative. In current IM, the central values are 50%, not zero.

In Lab space, the triplet (x,50%,50%), using the IM convention, is a neutral colour from black, through grey to white.

Therefore white in IM's Lab space is (100%,50%,50%).

Code: Select all

convert xc:srgb(100%,100%,100%) -colorspace Lab -set colorspace sRGB -depth 16 txt:

# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (99.9985%,50.0038%,49.9931%)  #FFFE80027FFB  srgb(99.9985%,50.0038%,49.9931%)
There is some rounding error. 100/65536 = 0.0015259, so the error in the b* channel is larger than I would like.
.
I have talked to tech people from the printer manufacturer. They pointet me towards whitepoint/Illuminant issue. But printer software, photoshop and IM use D50. So that was not the issue. Then I came back and studies all the posts again, and stumbled about this one. Seems that this is the issue - the rounding error: IM 'white' in cielab notation with this rounding error is 100,0,-1 - a really light shade of blue. But that's exactly what we get printet. So I guess I have to go to the bug forum and point some developer to this issue. Or Am I wrong?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

What gives you "100,0,-1"?

What version of IM are you running?
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

snibgo wrote:What gives you "100,0,-1"?

What version of IM are you running?
Whit cielab notation I mean the one that takes the central value of the a* and b* channels as 0 and the max/min values as -127,127. That what IM generates as white is 100,0,-1 - a light shade of blue, when in get printed. The printer software use that value. And if you check the IM generated files in Photoshop it gives you the same value.

Version: ImageMagick 6.8.9-5 Q16 i686 2014-07-01 http://www.imagemagick.org

And i believe that is the result of the rounding issue in the b channel, you talked about.
snibgo wrote:There is some rounding error. 100/65536 = 0.0015259, so the error in the b* channel is larger than I would like.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

The rounding error from IM is 4 parts in 65536, or 1 part in 16,000. This would not be visible, and is far less than 1 part in 127.
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

snibgo wrote:The rounding error from IM is 4 parts in 65536, or 1 part in 16,000. This would not be visible, and is far less than 1 part in 127.
Hmm, in every direction an dead end. :(

For testing reason we converted one file - 1px rgb white - with photoshop to lab, tif - and one file whith IM. The file from PS prints white, and the file from IM not. If you open the IM file in photoshop you get 100,0,-1. The printer guys stated, that exactly what the printer prints. I'm not an expert - otherwise I didn't need to ask here. Any hints, where I should look? If it helps, I can upload the three files somewhere for comparison.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

olafkarsten wrote:If it helps, I can upload the three files somewhere for comparison.
Yes.
snibgo's IM pages: im.snibgo.com
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: Montage - Colorspace Questions

Post by olafkarsten »

http://we.tl/8DbhSXIEVU

rgb.png is the white pixel

ps-lab.tif - the file generated with PS, prints fine

im-lab-16bit.tif - file generated with IM 16 Bit, prints very light shadow of something
im-lab-8bit.tif - file generated with IM 8 Bit, prints very light shadow of something

Code: Select all

convert rgb.png -colorspace Lab im-lab-16bit.tif

Code: Select all

convert rgb.png -colorspace Lab -depth 8 im-lab-8bit.tif
At the end we need an 8Bit file, as the printer software doesn't handle 16bit files.

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Montage - Colorspace Questions

Post by snibgo »

The pixels contain the same data:

F:\web\im\stoff>%IM%convert ps-lab.tif txt:
# ImageMagick pixel enumeration: 1,1,255,cielab
0,0: (255,0,0) #FF0000 cielab(255,0,0)

F:\web\im\stoff>%IM%convert im-lab-8bit.tif txt:
# ImageMagick pixel enumeration: 1,1,255,cielab
0,0: (255,0,0) #FF0000 cielab(255,0,0)

F:\web\im\stoff>%IM%convert im-lab-16bit.tif txt:
# ImageMagick pixel enumeration: 1,1,255,cielab
0,0: (255,0,0) #FF0000 cielab(255,0,0)


The metadata is different, but I don't know what would make a difference to the printer. The Photoshop file contains more metadata. Perhaps the bad profile makes a difference:

F:\web\im\stoff>%IM%convert rgb.png txt:

# ImageMagick pixel enumeration: 1,1,255,srgb
0,0: (255,255,255) #FFFFFF white
convert.exe: iCCP: Not recognizing known sRGB profile that has been edited `rgb.png' @ warning/png.c/MagickPNGWarningHandler/1832.

Try stripping the profile ("-strip") before making the IM files.

What type of printer is it?
snibgo's IM pages: im.snibgo.com
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Montage - Colorspace Questions

Post by glennrp »

snibgo wrote: convert.exe: iCCP: Not recognizing known sRGB profile that has been edited `rgb.png' @ warning/png.c/MagickPNGWarningHandler/1832.
That warning should not appear if you use IM-6.8.9-5 or later. But prior to that it's just a warning without any effect on the conversion.
Post Reply