-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to convert image to CMYK and display it - rgbData is not a valid imageData format #1
Comments
Hey the example is not complete, I will update it, you need to use createImageData to create a new object to to accept the converted colours image.onload = function() {
} |
Thanks a lot for the quick response! now the code is working, however, both images in the following example - based on your image to cmyk snippet with the fixes - look the same (original loaded, and the rgb->cmyk->rgb). EDIT: I had a bug in my code which caused the clamped array not to be manipulated at all, I now edited the code, but now it seems the conversion creates a white image... I had to go through format conversion since by default the transform array returns a float array.
Note: if this makes a difference, I am using the JapanColor2002Newspaper.icc profile for the cmyk coversion |
Hi A few things
If you're still having issues post your createTransform code and options as well. |
Thanks again, but still no luck. I failed to mention that I am trying this with the web in-browser file (jsColorEngineWeb.js). |
one small note: in the docs/readme you use {buildLUT: true}, but the code seems to expect builtLut as an option. |
I am trying to follow your code example for coverting an image to CMYK.
This part is failing:
var rgbData = cmyk2rgb.transformArray(cmykData, false, true);
ctx.putImageData(rgbData, 0, 0);
where I get an exception for putImageData parameter 1 is not of type ImageData.
I tried to fix the code by putting the result rgbData as the data field of a synthetic imageData object, but all my attempts failed. What am I missing?
The text was updated successfully, but these errors were encountered: