Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12522) program to convert an alpha-level PNG to a
Home

[Freeciv-Dev] Re: (PR#12522) program to convert an alpha-level PNG to a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12522) program to convert an alpha-level PNG to a no-alpha one
From: "Vijay Kiran Kamuju" <infyquest@xxxxxxxxx>
Date: Tue, 15 Mar 2005 23:31:07 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12522 >

in the pngquant command use the colors to be 256 (the maxcolors)

On Tue, 15 Mar 2005 20:47:11 -0800, Jason Short
<jdorje@xxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12522 >
> 
> This little program (which I put here for archiving) will convert a PNG
> file with alpha levels to one without.  It does so completely at random,
> making each pixel either solid or transparent depending on its alpha
> level.  Try compiling it and running as
> 
>    alpha fog.png fog.png
> 
> to convert an alpha-level fog to a B&W one.  Or run as
> 
>    for file in `find . -name "*.png"`; do
>      ~/alpha $file $file
>    done
> 
> to convert all PNGs in a directory (note this takes a while).  Or run as
> 
>    for file in `find . -name "*.png"`;
>      do ~/alpha $file $file;
>      file2=`echo $file | sed s/.png//`;

here is the modification

pngquant 256 $file 2>/dev/null && mv $file2-fs8.png $file;

>      pngquant $file 2>/dev/null && mv $file2-fs8.png $file;
>    done
> 
> to get rid of alpha and convert PNGs to indexed (useful for XAW-client
> users).
> 
> Unfortunately it doesn't give very good results ;-).  The result for
> darkness is pretty good but for repetitive fog is rather poor.  See
> 
>    http://freeciv.org/~jdorje/crazyfog2.png
>    http://freeciv.org/~jdorje/crazyfog.png
> 
> -jason
> 
> 
>





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#12522) program to convert an alpha-level PNG to a no-alpha one, Vijay Kiran Kamuju <=