CMYK images converted to RGB
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 5.3.1
- Platform / OS version: macOS 10.15.7
- URLs (if applicable):
- Node.js version: 12.16.1
What steps will reproduce the problem?
Please include code that reproduces the issue.
// give puppeteer access to file
const express = require('express')
const app = express()
app.use(express.static(__dirname))
app.listen(3000)
// generate pdf
const puppeteer = require('puppeteer')
const html = `
<html>
<body>
<img src="http://localhost:3000/Channel_digital_image_CMYK_color.jpg">
</body>
</html>`
;(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.setContent(html)
await page.pdf({ path: 'output.pdf' });
console.log('done')
})()
Here is the CMYK image I used: https://upload.wikimedia.org/wikipedia/en/2/25/Channel_digital_image_CMYK_color.jpg
What is the expected result? If I extract the image from the resulting pdf, it will remain in CMYK format.
What happens instead? The image is converted to RGB, causing the PDF colors to be wrong when printed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
Online CMYK to RGB conversion
Convert images from CMYK to RGB color space (using professional color profiles) with this free online converter.
Read more >Online RGB to CMYK conversion
Convert images from RGB to the CMYK color space (using a professional ICC profile) with this free online converter.
Read more >Convert CMYK to RGB online for free - Imageconvert.org
This tool is for converting from CMYK to RGB online without damaging the quality of resultant image.Our CMYK to RGB converter tool is...
Read more >How To Convert Images From CMYK To RGB Mode In ...
With the file open, go to Image>Mode and select RGB Color. You will see an on-screen prompt telling you to flatten the image...
Read more >Convert between color modes in Photoshop - Adobe Support
Learn how to use Adobe Photoshop to convert an image from one color mode to another, such as CMYK to RGB or color...
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 Free
Top 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

At the moment we are pre-calculating the RGB values using the same ICC color profile as our print-service and only use this RGB colors in our application.
We also tried Ghostscript but as you say it will not be the same as the original picture and it is very slow.
Are you generating a pdf with puppeteer and and then running it through Ghostscript afterwards? The image will technically be CMYK, but they will not match the colors of the CMYK image in the initial HTML file.