Hello -
So jsPDF is working wonderfully. However when I use addImage to add a .png image to the pdf, I am getting inconsistent results in terms of the color of the .png being added. This is how I am adding it:
doc.addImage(newimgData, 'png', 0.7, 3.4, updatedImgwidth, updatedImgheight);
This is what should be coming through:

However, this is what gets added to the pdf:

Notice how the blue turns to black? All kinds of incorrect colors. Anyone have any ways to fix this?
I'm having a similar issue. It was working properly maybe a month ago, but now there's incorrect coloring.
It's seems to be in relation with this topic .
But still no online solution...
I have a maybe related issue:
I have a PNG dataURI that I add to the pdf. It is a simple color gradient that I created in a canvas previously.
In the pdf, some colors are corrupted.
https://jsfiddle.net/jayfmbpk/5/
The same happens if I generate the dataURI as JPG and add it as JPG.
Any Ideas?
Hi
I'm facing the same issue when I use addImage to add PNG. In my original PNG there is no gAMA chunk, but jsPDF is introducing gAMA chunk while adding it to PDF. Request you to kindly expedite this issue at the earliest opportunity.
Thanks a lot.
Regards,
Anitha
Another case when the colour is not respected: http://jsfiddle.net/hvs91vpq/61/
Assuming you don't need the transparency that PNG provides:
canvas-background to apply a white background;addImage to use JPG — voila!Hi! Faced same issue...
@MrRio , @BiggA94 maybe someone of you guys can take a look please..
@jeneg use pdfkit as it is far better with a similar API.
Faced same issue too. Finally find pdfmake can replace jsPDF.So,hope it can help some one!
Does somebody have an example image?
The thing is, that jspdf converts the png file to a jpg. So actually there is no adding of a gAMA-Chunk to the PNG. But I guess, the conversion without respecting the gAMA-Chunk results into an improper JPG-Filee.
Duplicate of #762

Most helpful comment
It's seems to be in relation with this topic .
But still no online solution...