You are not logged in.

#1 2017-05-17 13:11:31

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,755

to png with transparency?

An image like this, is there a neat command line to turn this into png with transparency?
https://brontosaurusrex.github.io/media … rklift.jpg

Online

#2 2017-05-17 14:17:35

Naik
Member
From: the edge of insanity
Registered: 2015-10-03
Posts: 328

Re: to png with transparency?

Hey brontosurusrex!

To process gif images there are plenty of options using Imagemagick which AFAIK should also work *.png files but i`ve never tried this befor.

Anyways you could try something like:

convert foo.png  -fill transparent -opaque white  foo_transparent.png

If this doesn`t work you may have to wait for someone more knowledgeable or use gimp Colors -> Color to transparency dialogue.

naik --greetz


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen Codeberg

Offline

#3 2017-05-17 14:36:47

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,030

Re: to png with transparency?

That would be:

-transparent-color color

so:

-transparent-color white

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4 2017-05-17 15:00:49

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,755

Re: to png with transparency?

A single color transparency?

I'am thinking more like something that does:
a. copy paste this rgb to alpha channel (maybe invert)
a2. maybe normalize alpha
b. fill rgb with black

convert tmp.jpg \
\( -clone 0 -fill black -colorize 100% \) \
\( -clone 0 -negate \) \
-delete 0 -alpha off -compose copy_opacity -composite PNG32:tmp2.png

# from http://www.imagemagick.org/discourse-server/viewtopic.php?t=21677

^ This seems close, but open to better suggestions (imagemagick is really greek to me for some reason...)

output:
reinwentTheWheel.png

Last edited by brontosaurusrex (2017-05-17 16:55:51)

Online

#5 2017-05-18 05:59:44

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: to png with transparency?

brontosaurusrex wrote:

(imagemagick is really greek to me for some reason...)

me too, but it has exceptional documentation, plus dedicated tutorial sites, plus a forum.

Offline

#6 2017-05-18 16:28:53

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,030

Re: to png with transparency?

I love imagemagik ... but but ...

ohnonot wrote:

plus dedicated tutorial sites,
plus a forum.

now this I did not know ... the hunt is on.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

Board footer

Powered by FluxBB