Stroke around PNG with transparency in TCPDF

When you output a PNG image with transparency via TCPDF, a gray border appears at the junction of the transparency.

image in pdf

The original image has no borders

the original

How can this be overcome?

Author: Alexander Fedorov, 2016-02-03

2 answers

Maybe some configuration.

Most likely, this is due to the fact that when you change the size, the borders begin to be drawn.

Knowledgeable people recommend adding an 8-bit mask. example of an alpha channel

I haven't tried it myself, but the example from the official website should help.

 1
Author: Vladimir Ch, 2016-02-04 08:54:12

We also encountered a similar problem when printing documentation. We couldn't find a good solution, so instead of transparency, we just make a white background for all the images in the image editor.

With a white background, there is no problem with the outline, but it is a crutch. At that time, the decision was made and did not change further.

The day before, I was again puzzled by drawing PDF documents, I began to look at what was happening with this topic - I found this post.

Look to the side https://github.com/tecnickcom/TCPDF/blob/master/CHANGELOG.TXT

The new version is still in development, but according to Changelog: 6.2.11 (2015-08-02) - Bug #1070 "PNG regression in 6.2.9 (they appear as their alpha channel)" was fixed.

Try creating a document with a new version of the library, from GitHub. I tried it - there are no frames (or I don't see them).

 0
Author: wirtwelt, 2017-06-20 22:22:59