Node.js Node-js图像色彩空间从RGB到CMYK的变换
我尝试将图像的颜色空间从RGB转换为CMYK。我用夏普做这个Node.js Node-js图像色彩空间从RGB到CMYK的变换,node.js,rgb,color-space,cmyk,sharp,Node.js,Rgb,Color Space,Cmyk,Sharp,我尝试将图像的颜色空间从RGB转换为CMYK。我用夏普做这个 const sharp = require('sharp'); console.log('Converting...') sharp('C:/Users/eyup_/Desktop/indir.jpg') .toColourspace('cmyk') .toFile('output.jpg') .then(() => { console.log('Conversion complete
const sharp = require('sharp');
console.log('Converting...')
sharp('C:/Users/eyup_/Desktop/indir.jpg')
.toColourspace('cmyk')
.toFile('output.jpg')
.then(() => {
console.log('Conversion completed!')
});
输出图像颜色与输入图像颜色不同
您必须在能够感知颜色空间并支持显示CMYK图像的查看器中查看图像。如果我在Photoshop中打开你的图像(支持CMYK并支持颜色空间),它看起来更像原始图像(尽管仍然不一样,所以可能在转换过程中对图像做了其他操作)。所以,这可能至少在一定程度上是一个观看问题。