Author Topic: 4 bits per pixel image converter app  (Read 866 times)

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
4 bits per pixel image converter app
« on: January 05, 2018, 03:46:21 am »
Here is an image converter app (.TGA files only) that will convert the images to both c source code and binary file in a 4 bits per pixel format. The app is super simple to use : put it in your image folder, launch it and just type de filename without the extension. It will produce 2 files.

I've also included a demo to use it both for 16 Colors Lookup Table sprites (VDP1) and 16 Colors Bank (VDP2 Color RAM). The demo loads one sprite from c code and two from binary files. It displays one sprite using CRAM and two using CLUT. It's using JO Engine in a ghetto fashion as 4 bpp isn't supported, so let me know if it creates issues with your apps.

Using 4 bits per pixel sprites helps reducing the VRAM usage while also easily allowing you to use advanced VDP2 effects.

I did it quickly and didn't do much testing, let me know if it doesn't work well!

EDIT : Added a 4 bytes buffer to allow space for the data pointer
« Last Edit: January 22, 2018, 11:52:57 pm by XL2 »

itsstillthinking1999

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
    • View Profile
Re: 4 bits per pixel image converter app
« Reply #1 on: January 05, 2018, 04:16:11 am »
Will give it a try when i have time
« Last Edit: January 07, 2018, 10:28:31 pm by itsstillthinking1999 »

XL2

  • Sr. Member
  • ****
  • Posts: 341
  • Karma: +72/-1
    • View Profile
Re: 4 bits per pixel image converter app
« Reply #2 on: January 07, 2018, 04:49:35 am »
I did a small update : I fixed a bug with the sprite's orientation and also added auto-compression of the palette data if the image contains more than 16 colors (it's just removing the LSB until it fits, so the results aren't ideal compared to what you can get with something like Photoshop).

mindslight

  • Administrator
  • Full Member
  • *****
  • Posts: 157
  • Karma: +6/-1
    • View Profile
    • Jo Engine
Re: 4 bits per pixel image converter app
« Reply #3 on: January 07, 2018, 01:05:58 pm »
Very useful tool  ;D thx  ;)

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk