Dear visitors and members, with the staff having moved on to other life interests and as a result of changes in people's internet usage habits, the CodeWalrus community have migrated almost entirely to Discord, IRC and WalrusIRC and is now essentially a place where to hang out, chat about gaming, programming, music, anime, and chill. As a result, even though the CW forums will remain open for posting, for faster TI, Casio or HP calculator help and news we recommend using the bilingual TI-Planet forums instead.

We encourage everyone to join our Discord server now.

* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: ConvPNG  (Read 1526 times)

0 Members and 1 Guest are viewing this topic.

Offline MateoConLechuga

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 233
  • Post Rating Ratio: +21/-1
« on: March 23, 2016, 07:12:00 pm »
ConvPNG Link: Download

ConvPNG has just gotten a massive update, which will be extremely useful for C and ASM programmers alike. It can now take groups of images, determine the best palette for each group, and then convert each image using the palette. It also allows reserving a certain color for transparency, so you can have transparent sprites. Rather than being just a command-line tool, it now is more of a hybrid and uses 'convpng.ini' in the images directory in order to easily be able to group and convert images. A sample one with 2 palettes (or groups) may look like this:

Code: [Select]
#GroupC            : gfx_group_1
#Compression       : none                 (Compression type: none, rle, lz77)
#TranspColor       : 255,255,255,255      (Transparent color: r,g,b,a - a will most always be 255)
#Sprites           :                      (List of sprites for this group to convert)

#GroupC            : gfx_group_2
#Compression       : lz77                 (Compression type: none, rle, lz77)
#Sprites           :                      (List of sprites for this group to convert)

It also supports rle and lz77 compression of images, in order to help reduce size. Huffman was considered, but doesn't really perform well for palette-driven images. Color conversion is also a lot closer thanks to help from Runer. Overall, I hope that you all will find this quite useful :)

Let me know if you need any help working with it; or if you have and suggestions/comments. Enjoy! :D

For the technically inclined, it uses a combination of mediancut and K-means in order to choose the best palette for the groups of images.
« Last Edit: April 21, 2016, 02:20:09 pm by DJ Omnimaga »

Offline tr1p1ea

  • Full User
  • Join Date: Feb 2015
  • Location:
  • Posts: 275
  • Post Rating Ratio: +5/-1
Re: ConvPNG
« Reply #1 on: March 23, 2016, 09:16:43 pm »
Looks very nice Mateo.

The compression is a nice touch. I had experimented with lz77, huffman and pucrunch in the early days of the CSE.

Will you be providing decompression routines for users as well (if not so already)?

Offline c4ooo

  • Pedanticity prevents ambiguity
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location:
  • Posts: 1028
  • Post Rating Ratio: +13/-4
  • Advanced forumer
  • Gender: Male
Re: ConvPNG
« Reply #2 on: March 23, 2016, 09:43:25 pm »
This has been very useful for converting Minecraft assets into asm code :)

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18972
  • Post Rating Ratio: +100/-5
    • dj_omnimaga
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: ConvPNG
« Reply #3 on: March 24, 2016, 04:01:02 am »
That is nice Mateo. I was always wondering how one could easily generate a decent palette for use in 8 bits mode for his CE graphics. Glad that they're compressed as well
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Retired Omnimaga admin (2001-11) and editor (2012-14)


You can also use the following HTML or bulletin board code to share it on your page or forum signature!

Also do not forget to check our affiliates below.
Planet Casio TI-Planet BroniesQC BosaikNet Velocity Games