How to create a tiff file in lab colorspace

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
cjmi
Posts: 11
Joined: 2012-06-28T20:31:04-07:00
Authentication code: 13

How to create a tiff file in lab colorspace

Post by cjmi »

Running into a lot of problems using LAB. Is LAB implementation still in progress, or am I doing it wrong? If in progress, is there another library I should consider for now?

identify -verbose out.tif <-- 6.7.8-0 w/ HDRI
.....
Colorspace: sRGB
.....

:shock: :( :?

Code: Select all

#include <list>
using namespace std;

#include "Magick++.h"
using namespace Magick;

int main(int argc, char** argv) {
   InitializeMagick(*argv);
   Image image(Geometry(100, 100), ColorRGB(0, 0, 0)); // This won't be in LAB, just start us off with black background
   image.colorSpace(LabColorspace);
   image.quantizeColorSpace(LabColorspace);
   list<Drawable> drawList;
   drawList.push_back(DrawableFillColor(ColorRGB(0.5, 0, 0)));
   drawList.push_back(DrawableRectangle(0, 0, 99, 99)); // This should fill the entire document with LAB 50, 0, 0 (gray)
   image.draw(drawList);
   image.write("out.tif");
}
Post Reply