I have dither=false off in my Color Settings/Conversion Options, but when I use getPixels({colorSpace: “Lab”}) on a RGB document, the LAB pixels I get back are the same pixel values I get if I use photoshop to convert the image to lab with dither=true.
Simple workaround is to duplicate doc, change mode to LAB, get pixels, close without saving. If you want to disable dithering ( for the changeMode, this doesn’t help with getPixels ) here is how you can check it and set it:
async function getDither() {
const result = await batchPlay([{
_obj: "get",
_target: [
{ _ref: "property", _property: "colorSettings" },
{ _ref: "application", _enum: "ordinal", _value: "targetEnum" }
]
}], {});
return (result[0].colorSettings?.dither);
}
async function setDither(enabled) {
await batchPlay([{
_obj: "set",
_target: [
{ _ref: "property", _property: "colorSettings" },
{ _ref: "application", _enum: "ordinal", _value: "targetEnum" }
],
to: {
_obj: "colorSettings",
dither: enabled
}
}], {});
}
2 Likes