How to create a tiff file in lab colorspace
Posted: 2012-06-29T23:33:24-07:00
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
.....

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



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");
}