|
|
How to remove alpha channel from PNG... help please!
Hi all! Sorry to be a little off-topic.
I'm looking for some good resources/experiences in assisting me adapt some
images for a product I'm developing. A little bit of background is necessary
to set the stage (warning: a little bit techy..). I'm developing a .NET
application using standard Windows controls (Tree/ListView). These controls
are 'fed' images by way of a support control called an ImageList. For
Windows XP this mechanism will perform exactly as required and show images
(full colour PNG files) with their alpha channel intact. However for *any*
older platform (Win2K and previous) the alpha channel is destroyed thus
leaving the control showing images with severe jagged edges (example of
which at end of post).
My images are a set of [freeware] full colour PNG images complete with their
alpha channel and clearly designed with WindowsXP in mind. These will fit in
well (in terms of imagery) with what I'm trying to portray and (as I said)
work great for Windows XP. To get around the limitations (well documented
and with no suitable workarounds) of the ImageList control on earlier
platforms, I'm planning on providing a different (edited) image set. Not too
'different' just manually edited so the images don't look so jagged.
So, I'd like to edit the images [using PSP8.1] removing the alpha channel
manually but somehow leaving an image that has a reasonable edge surrounded
by a single colour transparency key. Can anyone give me any really useful
tips on how I'd go about performing this rather arduous task or maybe point
me to some online articles?
Here's one of my icons - remember that IE will *not* display the PNG alpha
channel correctly either (what has MS got against this technology???) so
you'll have to Save As and open up in PSP.
Full alpha blended image:
http://www.clankak.co.uk/alpha/user%20alphachannel.png
This is how it looks when the image is displayed under Windows 2000 (and the
alpha channel is broken):
http://www.clankak.co.uk/alpha/user%20alphabroken.png
This is how the image looks if I save with a single colour transparency from
within PSP8
http://www.clankak.co.uk/alpha/user%20singlecolour.png
This is how the image looks if I save with no transparency from within PSP8
http://www.clankak.co.uk/alpha/user%20notransparency.png
As we have no control over what colour the background of the control where
these images are shown will be set at, I cannot simply save the images with
no transparency (as shown in the last example picture).
All help/guidance *very* much appreciated!
Thanks in advance, Adam
|
|
0
|
|
|
|
Reply
|
Reckless
|
1/29/2004 11:54:26 PM |
|
Wasn't it Reckless who wrote:
>I'd like to edit the images [using PSP8.1] removing the alpha channel
>manually but somehow leaving an image that has a reasonable edge surrounded
>by a single colour transparency key. Can anyone give me any really useful
>tips on how I'd go about performing this rather arduous task or maybe point
>me to some online articles?
Since you're limited to single colour transparency, the result is never
going to get results that are as good as having a proper alpha channel.
I can suggest a couple of things you can try that might improve things.
Here's the first one:-
Add a new layer under the original partially transparent image and fill
that layer with a neutral looking mid grey.
Merge the layers.
Use Export=>PNG Optimiser to output with settings:
Single colour transparency
Areas that match this colour (your mid grey)
Tollerance: about 25
This produces something like the result that you got, but with the edges
fading to a neutral mid grey instead of to black.
Problem: If there are neutral looking mid grey pixels in your source
image they become transparent.
Here's the second one:-
Produce a temporary single colour transparency image, use the magic
brush to select the transparent area. Invert the selection,
modify:expand it by one pixel and save the selection to an alpha
channel.
With the original partially transparent image, perform one of the free
Solidify plugins from Flaming Pear. These plugins look at the colours of
pixels near the edges of transparent regions and fill the transparent
region with similar colours. "Solidify A" and "Solidify B" work
similarly but use slightly different algorithms.
Now perform a "load mask" from the alpha channel that you saved earlier.
When you're happy with a method, you can record it as a script and batch
process all your images.
--
Mike Williams
Gentleman of Leisure
|
|
0
|
|
|
|
Reply
|
Mike
|
1/31/2004 6:54:06 AM
|
|
Hi Mike,
Thanks for your tips! I didn't really get on to well with option 2 so I've
decided to have a go with option 1. Clearly I might be in for a bit of
colour editing if I'm unlucky with the colour usage. My initial images have
turned out well.
I was a tad confused over Solidify A & B as I only had 'one' Solidify - then
I went to Flaming Pear's website to find that they had improved the freebies
pack somewhat since I grabbed it ages ago.
Thanks again :)
"Mike Williams" <nospam@econym.demon.co.uk> wrote in message
news:ob1y6AAOE1GAFwfR@econym.demon.co.uk...
> Wasn't it Reckless who wrote:
>
> >I'd like to edit the images [using PSP8.1] removing the alpha channel
> >manually but somehow leaving an image that has a reasonable edge
surrounded
> >by a single colour transparency key. Can anyone give me any really useful
> >tips on how I'd go about performing this rather arduous task or maybe
point
> >me to some online articles?
>
> Since you're limited to single colour transparency, the result is never
> going to get results that are as good as having a proper alpha channel.
> I can suggest a couple of things you can try that might improve things.
>
> Here's the first one:-
>
> Add a new layer under the original partially transparent image and fill
> that layer with a neutral looking mid grey.
>
> Merge the layers.
>
> Use Export=>PNG Optimiser to output with settings:
> Single colour transparency
> Areas that match this colour (your mid grey)
> Tollerance: about 25
>
> This produces something like the result that you got, but with the edges
> fading to a neutral mid grey instead of to black.
>
> Problem: If there are neutral looking mid grey pixels in your source
> image they become transparent.
>
>
> Here's the second one:-
>
> Produce a temporary single colour transparency image, use the magic
> brush to select the transparent area. Invert the selection,
> modify:expand it by one pixel and save the selection to an alpha
> channel.
>
> With the original partially transparent image, perform one of the free
> Solidify plugins from Flaming Pear. These plugins look at the colours of
> pixels near the edges of transparent regions and fill the transparent
> region with similar colours. "Solidify A" and "Solidify B" work
> similarly but use slightly different algorithms.
>
> Now perform a "load mask" from the alpha channel that you saved earlier.
>
>
> When you're happy with a method, you can record it as a script and batch
> process all your images.
>
> --
> Mike Williams
> Gentleman of Leisure
|
|
0
|
|
|
|
Reply
|
Reckless
|
2/1/2004 12:56:37 AM
|
|
|
2 Replies
2330 Views
(page loaded in 0.042 seconds)
|
|
|
|
|
|
|
|
|