Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: potrace color option -C #rrggbb, --color #rrggbb #6

Open
leandro2222 opened this issue Apr 24, 2017 · 1 comment
Open

Comments

@leandro2222
Copy link

leandro2222 commented Apr 24, 2017

this potrace option would be useful in the cases when we have a black image on transparent background because the current javascript version transforms the alpha channel in black so dark pictures with transparent backgrounds don't show up.

example

ps: great work, thanks and congratulations.

@leandro2222
Copy link
Author

leandro2222 commented Apr 24, 2017

Workaround that I'm currently using to let the alpha white (don't work in Firefox and MS Edge when the image comes from the clipboard because their clipboard dont support alpha):

function loadCanvas() {
imgCanvas.width = imgElement.width;
imgCanvas.height = imgElement.height;
var ctx = imgCanvas.getContext('2d');
ctx.beginPath();
ctx.rect(0, 0, imgElement.width, imgElement.height);
ctx.fillStyle = "white";
ctx.fill();

ctx.drawImage(imgElement, 0, 0);
}

example

DEMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant