Closed eosti closed 2 years ago
Thanks for report this issue. As far as artem
is concerned, those are actually two very different images, since pixels with an alpha value of 0 are the same as black pixels. So the first image is basically black of black. Nevertheless I agree that the first image does not produce a desired output.
Sadly, I think it would not be a very practical solution to check if black-on-alpha exist. It would be better to use the alpha value in the calculation, but I will have to think about this.
After thinking about it for a bit, I came to the conclusion that the best solution, without breaking conversions of different images, would be to add the ability to replace certain colors, but I think that would be out of scope and better be suited for an image editor, which this does project does not aim to be.
And if artem
would recognize black-on-alpha, the black would be rated as a lighter color, so the result would look more like this, which still would not be similar to your expected result.
.':ldOKNMMMMNKOdl;'.
.,oXMMMMMMMMMMMMMMMMMMMMMM0l'
.cKMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO;.
;KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMx'
cNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO,
,NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMk.
xMMMMMMMMMMMMMMMMKl,.. ..;oXMMMMMMMMMMMMMMMM:
kMMMMMMMMMMMMMMX;. .:NMMMMMMMMMMMMMMc
OMMMMMMMMMMMMMK, ;NMMMMMMMMMMMMMc
:MMMMMMMMMMMMMd kMMMMMMMMMMMMM.
WMMMMMMMMMMMMd kMMMMMMMMMMMMk
'MMMMMMMMMMMMM .MMMMMMMMMMMMM.
:MMMMMMMMMMMMM MMMMMMMMMMMMM'
:MMMMMMMMMMMMM MMMMMMMMMMMMM'
.MMMMMMMMMMMMM. ,MMMMMMMMMMMMM.
0MMMMMMMMMMMMK. .WMMMMMMMMMMMMO
'MMMMMMMMMMMMMX. ,WMMMMMMMMMMMMM'
dMMMMMMMMMMMMMMo. .xMMMMMMMMMMMMMMx
dMMMMMMMMMMMMMMM0:. .cKMMMMMMMMMMMMMMMk
dMMMMMMMMMMMMMMMMMMOl:,'''',:l0MMMMMMMMMMMMMMMMMMO
cMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
'WMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:
.dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO.
;NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMl
oMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMk.
'KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW:
lMMMMMMMMMMMMMMMMMMMMMMMMMMMMd
.xMMMMMMMMMMMMMMMMMMMMMMMMk.
'KMMMMMMMMMMMMMMMMMMMMX,
oMMMMMMMMMMMMMMMMMMo
.OMMMMMMMMMMMMMMO.
cMMMMMMMMMMMM:
.KMMMMMMMM0.
oMMMMMMl
:MMMM,
'KO.
I'm closing this for now, if you disagree, feel free to reopen this issue and discuss a better solution, or open a pr with it.
Describe the bug When attempting to convert an image that has exclusively black content with an alpha (transparent) background,
artem
considers black and alpha to be the same colour, resulting in no output.To Reproduce Image that is black-on-alpha:
Output (yes, it's blank):
Expected behavior This is the same file, but saved with no alpha, which becomes a white background:
Output:
It would be nice if
artem
would be able to autodetect the black-on-alpha condition and make the alpha equivilant to white, instead of black. There are many icon-type images that are formatted like this, and it's a bit tedious to have to convert each to a non-alpha image first.Information
MacOS Monterey, zsh, artem 1.1.5
Output
Output
``` > artem icon.png [INFO ] Checking inputs [DEBUG] Input icon.png is a file [INFO ] Using default characters [DEBUG] Characters used: "MWNXK0Okxdolc:;,'... " [DEBUG] Target Size: 80 [DEBUG] Scale: 0.42 [DEBUG] Invert is set to: false [DEBUG] BackgroundColor is set to: false [INFO ] Using colored ascii [INFO ] Using truecolor ascii [INFO ] Using border: false [DEBUG] Flipping X-Axis: false [DEBUG] Flipping Y-Axis: false [DEBUG] Centering X-Axis: false [DEBUG] Center Y-Axis: false [DEBUG] Outline: false [DEBUG] Target: Shell [INFO ] Opening image [INFO ] Converting img: icon.png [DEBUG] Using inverted color: false [DEBUG] Input Image Width: 512 [DEBUG] Input Image Height: 512 [DEBUG] Columns: 80 [DEBUG] Rows: 36 [DEBUG] Tile Width: 6 [DEBUG] Tile Height: 14 [INFO ] Resizing image to fit new dimensions [DEBUG] Resized Image Width: 480 [DEBUG] Resized Image Height: 504 [INFO ] Starting conversion to ascii [INFO ] Printing output [[blank output, as shown above]] ```