jimp-dev / jimp-dev/jimp

"print" method on transparent background produces black fringe

Open
#652 2 comments 0 reactions 0 assignees View on GitHub
bug help wanted solution in issue
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

# 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.