stats() on CMYK image: vips_colourspace: no known route from 'cmyk' to 'b-w'
See original GitHub issueThe following code (with a CMYK JPEG as input) gives the error outlined below:
const sharp = require('sharp')
sharp('cmyk.jpg')
.stats()
.then(res => console.log('SUCCESS', res))
.catch(err => console.error('ERROR', err))
Output:
ERROR [Error: vips_colourspace: no known route from 'cmyk' to 'b-w']
The following seems to work:
const sharp = require('sharp')
sharp('cmyk.jpg')
.toColorspace('srgb')
.toBuffer()
.then(res => sharp(res).stats())
.then(res => console.log('SUCCESS', res))
.catch(err => console.error('ERROR', err))
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
No known route from 'cmyk' to 'srgb' when processing images
I am having an issue with some data returned from an external API to my GatsbyJS/ReactJS site. More specifically, the issue appears to...
Read more >GIMP/CMYK support - ArchWiki
This article will show how to enable rudimentary CMYK support in Gimp using the Separate and Separate+ plug-ins, and explain how to use...
Read more >Force Color Images to CMYK with a 240% Ink Limit
So a 240% TAC means there shouldn't be any place on your page that has more than 240% total ink—which can happen pretty...
Read more >How to Convert RGB to CMYK in Photoshop and InDesign
This guide will explain the best way to convert RGB to CMYK in Photoshop and InDesign so you have more control over your...
Read more >10 Pre-Press Tips For Perfect Print Publishing
A lot of designers think CMYK is the way to go when designing for print. We will, of course, always use CMYK-based ink,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sharp v0.23.0 / libvips v8.8.1 is now available.
Hi. Sorry to chime-in that late, but I can’t get this to work either:
This returns the same stats, whether I convert to
'srgb'
, or'lch'
, or'lab'
. Am I not understanding thestats
function correctly? I thought it would give me the stats for the L, C, H channels, which would be different than stats for R, G, B channels.Thanks