Page 2 of 2
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T13:56:29-07:00
by i73
i73 wrote:fmw42 wrote:
But it would help if you post your PSD image or the input images, so we can test with them. Not screen shots, but the actual images.
Giving you the image won't be of any use to you because I cannot save the Alpha the way I want to in either (code, IM, photoshop, gimp) so you cannot see the desired effect, but here they are:
The two test images that I try and copy Test.png to Test2.png Alpha channel:
http://www.fast-files.com/getfile.aspx?file=120064
The output image that it gives me:
http://www.321webs.com/download/120065.htm
-If you open that file in Gimp you can notice how the Alpha channel is a box and it's multiplied along all the RGB? I don't want that. I want the box to stay in the Alpha channel and the bars to stay in the RGB channels.
In C# and C++ the image is multiplying (Taking the alpha channel and applying it to the RGB channels) I don't want this, I am told that IM can do what I am looking to do, Literally I am trying to take ImageA.png and move it into the alpha channel in imageB.png without having ImageB.png RGB channels effected by it's Alpha channel.
I want to make a image with 4 channels:
Red: imageA.png -R
Green: imageA.png -G
Blue: imageA.png B
Alpha: imageB.png -RGB or Greyscale
I don't want transparency to be applied to RGB channels, I want the Alpha channel to act as a layer where I can place a image, 'essentially' making one png file hold two images one in the RGB another in the A.
I am told that IM can do this so don't shoot me if PNG's cannot support this type of thing.
Thanks so much guys,
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T13:56:45-07:00
by i73
i73 wrote:i73 wrote:fmw42 wrote:
But it would help if you post your PSD image or the input images, so we can test with them. Not screen shots, but the actual images.
Giving you the image won't be of any use to you because I cannot save the Alpha the way I want to in either (code, IM, photoshop, gimp) so you cannot see the desired effect, but here they are:
The two test images that I try and copy Test.png to Test2.png Alpha channel:
http://www.fast-files.com/getfile.aspx?file=120064
The output image that it gives me:
http://www.321webs.com/download/120065.htm
-If you open that file in Gimp you can notice how the Alpha channel is a box and it's multiplied along all the RGB? I don't want that. I want the box to stay in the Alpha channel and the bars to stay in the RGB channels.
In C# and C++ the image is multiplying (Taking the alpha channel and applying it to the RGB channels) I don't want this, I am told that IM can do what I am looking to do, Literally I am trying to take ImageA.png and move it into the alpha channel in imageB.png without having ImageB.png RGB channels effected by it's Alpha channel.
I want to make a image with 4 channels:
Red: imageA.png -R
Green: imageA.png -G
Blue: imageA.png B
Alpha: imageB.png -RGB or Greyscale
I don't want transparency to be applied to RGB channels, I want the Alpha channel to act as a layer where I can place a image, 'essentially' making one png file hold two images one in the RGB another in the A.
I am told that IM can do this so don't shoot me if PNG's cannot support this type of thing.
Thanks so much guys,
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T14:14:40-07:00
by snibgo
Your output.png contains exactly what you say you want: the RGB channels have come from test.png, and the alpha channel has come from the grayscale of test2.png.
If you open output.png in Gimp, and un-erase ("anti erase") the pixels, you get the same colours as test.png
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T14:36:58-07:00
by i73
snibgo wrote:Your output.png contains exactly what you say you want: the RGB channels have come from test.png, and the alpha channel has come from the grayscale of test2.png.
If you open output.png in Gimp, and un-erase ("anti erase") the pixels, you get the same colours as test.png
Thanks so much, I am trying to understand what you mean by anti erase? I am not familliar with gimp could you screen shot how you have the bars without the Alpha channel?
This is what I have:
Thanks for your help!!!
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T15:17:12-07:00
by snibgo
My version of Gimp (2.
may be different to yours, with different layout etc.
Open output.png. View it at 800% or so. Click on "erase" tool. In the "tool options" window, click the "hard edge" and "anti erase" boxes.
Normal erase reduces opacity. "Anti erase" increases opacity.
An alternative method is to select just the alpha channel (from the toolbox shown in your screenshot), and paint white over it. This, again, sets alpha to 100%.
This should convince you that output.png contains exactly the data you asked for.
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T15:27:48-07:00
by fmw42
i73 wrote:I don't want transparency to be applied to RGB channels, I want the Alpha channel to act as a layer where I can place a image, 'essentially' making one png file hold two images one in the RGB another in the A.
I am told that IM can do this so don't shoot me if PNG's cannot support this type of thing.
Who told you that and what exactly did they tell you?
IM does not support saving an image with more than 1 alpha channel. Again you can put any grayscale image into the alpha channel of an image and save as PNG. I do not think PNG supports more than 1 alpha channel.
When IM adds an alpha channel to an RGB image and it is saved as PNG, the alpha channel is applied to the RGB channels by default. When you open the png in IM and process with convert, you can disable the alpha channel.
i73 wrote:I want to make a image with 4 channels:
Red: imageA.png -R
Green: imageA.png -G
Blue: imageA.png B
Alpha: imageB.png -RGB or Greyscale
IM can take imageA with RGB and add any channel or a grayscale version of imageB to the alpha channel of imageA, but when saved, the alpha channel will be applied to the RGB channels. It can be disabled during a convert command and the RGB channels can be saved out afterwards.
You cannot add more than one alpha channel to an image in IM6. But you can in IM7, however, you cannot save the result to any format including PNG at the current time. You can only save it to one of the IM formats such a MIFF or MPC.
I cannot find a way to download your files from
http://www.fast-files.com. Can you explain how to download from that site without having to download and install any of the advertised software.
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2016-08-25T15:39:04-07:00
by i73
snibgo wrote:My version of Gimp (2.
may be different to yours, with different layout etc.
Open output.png. View it at 800% or so. Click on "erase" tool. In the "tool options" window, click the "hard edge" and "anti erase" boxes.
Normal erase reduces opacity. "Anti erase" increases opacity.
An alternative method is to select just the alpha channel (from the toolbox shown in your screenshot), and paint white over it. This, again, sets alpha to 100%.
This should convince you that output.png contains exactly the data you asked for.
FFS... It was a bug on our engine... You were right, If I knew about the Anti Erase (Alt) I would have been able to tell the engies it's their fault (as it always is
), I was actually doing the same thing with IM as C++ and C#.
Thank you for all your help!!!
Re: How to copy a PNG to another PNG alpha channel?
Posted: 2017-04-04T17:35:37-07:00
by fmw42
PNGs do not support layers. But you can put a separate grayscale (not RGB) image into the alpha channel of an RGB (3 channel) png.