Lab and TXT-Format

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
unnamedguy

Lab and TXT-Format

Post by unnamedguy »

hi magickians,

i’ve a tiny problem to convert a Lab-TIFF file to TXT. it seems that imagemagick converts Lab-TIFF to RGB-TXT automatically. is there an option to convert an Lab-TIFF to an Lab-TXT file? if not: does anybody knows a work around to get the Lab-TIFF into a human readable file format?

thanx a lot
andreas
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Lab and TXT-Format

Post by anthony »

You could separate the LAB channels using -separate, then output each channel as a TXT: image or a simpler PGM list of numbers.

Code: Select all

convert image.tiff -colorspace LAB -separate -compress none LAB_channel_%d.pgm
The -compress none overrides the default 'binary' compression for the PGM image file format to produce a text file of the image values, with a simple small header.

At this time the TXT, ImageMagick pixel enumeration format only understands
RGB and RGBA colorspace images.

If you ask (on developers forum), it may be possible for the TXT; image format can be extended to enclude the colorspace of the output image, allowing you to output LAB images more directly, while still alowing IM to read such a image format. The coder needs to understand colorspace for both the input and output directions.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
unnamedguy

Re: Lab and TXT-Format

Post by unnamedguy »

thanx for your answer, but this one does not work for me. Lab has 3 axes, one for luminance and two describing the colors. the imagemagick-txt-format works fine with rgb and cmyk images. the only thing it should do is: read the color information and write down the values, nothing else. your example creates 3 files with – i think – 16 bit data, from a picture which has only 8 bit.

i’ll try to explain it for the developers :)

thanx anyway.

andreas
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Lab and TXT-Format

Post by anthony »

The next release which is beta testing right now will have LAB colorspace TXT: output (or any other colorspace :-) ) You can use -depth to set the output quality for the files, otherwise it will default to your compile time IM Q level.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply