jimp-dev/jimp

"print" method on transparent background produces black fringe

Open

#652 geöffnet am 28. Okt. 2018

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (785 Forks)batch import
bughelp wantedsolution in issue

Repository-Metriken

Stars
 (13.218 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Expected Behavior

Printing text on a image with a transparent background should result in text with a transparent fringe.

Current Behavior

Instead of a transparent fringe, the text is drawn with a black fringe.

Possible Fix

In the drawCharacter method of plugin-print, changing:

image.blit(characterPage, x + char.xoffset, y + char.yoffset, char.x, char.y, char.width, char.height);

...to:

image.composite(characterPage.clone().crop(char.x, char.y, char.width, char.height), x + char.xoffset, y + char.yoffset);

...seems to "fix" the fringe. There may be a more efficient way to do it though!

Contributor Guide