Working with alpha channel
Working with alpha channel
Good evening!
Tell me, please, in the next issue.
There is the original image with an alpha channel.
Beneath the alpha channel is here is a picture
Tell me, how do I do it like this, while preserving the alpha channel of the image.
Tell me, please, in the next issue.
There is the original image with an alpha channel.
Beneath the alpha channel is here is a picture
Tell me, how do I do it like this, while preserving the alpha channel of the image.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
I don't understand what you want. Perhaps:
Code: Select all
convert alfThing.png -alpha off -fill White -opaque Black -alpha on a.png
snibgo's IM pages: im.snibgo.com
Re: Working with alpha channel
Thank you so much!
I noticed this solution is not suitable for such images here
How can I fix it?
I noticed this solution is not suitable for such images here
How can I fix it?
Re: Working with alpha channel
I need everything to black under the alpha channel turned white
Re: Working with alpha channel
I need to get out of this picture here is
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
The following gives the coordinates of the "bird" image:
From the result, a script can do the rest of the work.
Code: Select all
convert bird.png -alpha off -format "%@" info:
snibgo's IM pages: im.snibgo.com
Re: Working with alpha channel
Not quite understand you, if not difficult to please explain in detail.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
The result you want has some pixel colours smeared to the left and right (shown in red), and others are not smeared (shown in green).
What rules say which should be smeared, and which should not?
What rules say which should be smeared, and which should not?
snibgo's IM pages: im.snibgo.com
Re: Working with alpha channel
Here is an image without blurring with a white background
As can be seen the black is present there originally, and that's how to determine that relate to image blur, and what does not define apparently did not happen.
As can be seen the black is present there originally, and that's how to determine that relate to image blur, and what does not define apparently did not happen.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
This smearing effect could easily be done in a process module: loop through the lines; in each line, find the first non-white pixel, copy its values to the white pixels on the left, and similarly for the right-hand side.
I can't see an easy way of doing it at the command-line. It could be done with a complex script that used the same method.
Or a command might build a displacement map, as shown in http://im.snibgo.com/ckbkClut.htm#graph .
Or the white pixels could be made transparent, and a small blur would smear the visible pixels sideways. Repeat until no transparency remains. This method would be imprecise, and slow.
Someone else may have a better method.
I can't see an easy way of doing it at the command-line. It could be done with a complex script that used the same method.
Or a command might build a displacement map, as shown in http://im.snibgo.com/ckbkClut.htm#graph .
Or the white pixels could be made transparent, and a small blur would smear the visible pixels sideways. Repeat until no transparency remains. This method would be imprecise, and slow.
Someone else may have a better method.
snibgo's IM pages: im.snibgo.com
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
Or we can repeatedly compose over, shifting the bottom image slightly. Windows BAT syntax:
birdBkW.png:
birdtw.png
Code: Select all
convert ^
birdBkW.png ^
-transparent White ^
-compose DstOver ^
( -clone 0 ) -geometry +1+0 -composite ^
( -clone 0 ) -geometry +2+0 -composite ^
( -clone 0 ) -geometry +4+0 -composite ^
( -clone 0 ) -geometry +8+0 -composite ^
( -clone 0 ) -geometry +16+0 -composite ^
( -clone 0 ) -geometry +32+0 -composite ^
( -clone 0 ) -geometry +64+0 -composite ^
( -clone 0 ) -geometry +128+0 -composite ^
( -clone 0 ) -geometry -1+0 -composite ^
( -clone 0 ) -geometry -2+0 -composite ^
( -clone 0 ) -geometry -4+0 -composite ^
( -clone 0 ) -geometry -8+0 -composite ^
( -clone 0 ) -geometry -16+0 -composite ^
( -clone 0 ) -geometry -32+0 -composite ^
( -clone 0 ) -geometry -64+0 -composite ^
( -clone 0 ) -geometry -128+0 -composite ^
-background White -compose Over -layers flatten ^
birdtw.png
birdtw.png
snibgo's IM pages: im.snibgo.com
Re: Working with alpha channel
Thank you for choosing
I for some reason is obtained as follows
And is it possible to preserve the transparency image
I for some reason is obtained as follows
And is it possible to preserve the transparency image
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Working with alpha channel
What was your exact command? What version of IM are you using? I use v6.9.0-0.
The input file, birdBkW.png, has no transparency.
You could copy the transparency from an image that has transparency:
The input file, birdBkW.png, has no transparency.
You could copy the transparency from an image that has transparency:
Code: Select all
convert ^
birdBkW.png ^
birdWithTrans.png ^
-compose CopyOpacity -composite ^
smearedWithTrans.png
snibgo's IM pages: im.snibgo.com
Re: Working with alpha channel
Figured out, I just used, that this image
And you can use the above image, to obtain the same result
But at the same time that the layer alpha channel is preserved?
And you can use the above image, to obtain the same result
But at the same time that the layer alpha channel is preserved?