public
Last active

Export PNG8 With Alpha

  • Download Gist
export_png_8_with_alpha.textile
Textile

Choose your colors:

  • Open original file in Photoshop
  • Select relevant areas (“Marquee”)
  • Choose: Selection > Save Selection…
  • Enter name eg: “Colors” and hit “Save”

Remove transparent areas:

  • Select layer alpha (“CMD+Click” on layer)
  • Switch to Quick Mask mode (Hit “Q”)
  • Choose: Image > Adjustments > Threshold
  • Set “Level” to 255 and “Save”
  • Leave Quick mask mode (Hit “Q”)
  • Choose: Select > Inverse
  • Remove transparent parts (Hit “Backspace”)

Export indexed image:

  • Choose: Save > Save for Web & Devices…
  • Select: PNG 8, Selective, 200 Colors, No Dither
  • Click “Modify Color Reduction…”
  • Choose Channel: “Colors” and hit “Ok”
  • Set Matte to Pink
  • Leave “Interlace” unchecked
  • Check “Transparency”
  • Hit “Save” and name it “sprite_index.png”

Select transparency areas only:

  • Open original file in Fireworks
  • Rename layer to “alpha”
  • Choose: File > Import… “sprite_index.png”
  • Rename layer to “index”
  • Select transparency (“ALT+Click” on indexed layer)
  • Select original layer and remove colors (Hit “Backspace”)
  • Hide “index” layer

Export alpha channel only:

  • Switch to “Preview” mode
  • Select: PNG8, Adaptive, 30 Colors, Dither 0, Alpha Transparency
  • Choose File > Export… and name it “sprite_alpha.png”

Merge indexed and alpha channel:

  • Open “sprite_alpha.png” in Fireworks
  • Choose: File > Import… “sprite_index.png”
  • Choose: File > Save As… and name it “sprite_merged.png”

Quantize merged image:

  • Download pngquant from http://pornel.net/pngquant
  • Put it into your image path
  • Open terminal and run “pngquant sprite_merged.png”
  • Bingo: The result “sprite_merged-fs8.png” is your 8 bit baby!

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.