gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Compression Tutorial for GBA

#15881 - headspin - Mon Feb 02, 2004 3:17 pm

I have written a tutorial that covers graphics compression, the GBFS (Tepples Gameboy File System), JPEG images and the common problem people have with palettes in tiles and sprites on the GBA. Future versions should cover screen effects and audio compression.

The URL is
http://members.iinet.net.au/~freeaxs/gbacomp/

It basically covers some of the areas I've been researching recently. I hope this can be of some use to someone.

#15884 - RaBBi - Mon Feb 02, 2004 4:09 pm

Great Great Great !!

Today is a great day ! ^^
(great demo and great tools (Grafx2), even on devrs.com ^^)

GBFS use and Compression were subjects I wanted more info about.
I didn't plan to look at them for now, but your tuto seems to be very clear, so I change my mind and I'm going to study it.

Thank very very much :)
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#15885 - headspin - Mon Feb 02, 2004 4:22 pm

Hey I'm glad I can help u RaBBi! Yes, I think GBFS and compression are very important subjects to learn for GBA programming, which is why I made this tute. Hmm, first tute on the subject maybe? I hope this helps alot of people.

:)

Also I request any info I may of missed or may be of help, e-mail me on the address provided on the page and I will (hopefully) be able to add your info (with acknowlegement to yourself of course)

#15890 - RaBBi - Tue Feb 03, 2004 1:35 am

You should be glad ^^

I finally read it and it's a very clear tuto.
I understand all that I read, and I'm really happy cause it's almost the first time on a technical web page about the GBA ^^
(even sometimes, in certain topics of this board, I'm lost ^^, never desesperate cause I know that someday it would be ok for me ^^
I'm not different from the others dude! lol)

I appreciate the LZ77 and JPEG image chapters ^^
In fact, the tools you brought are really helpfull and I didn't think it would very simple to use them, even in code while calling functions ^^

So I'm really waiting for "Coming Soon..." sections ^^
And I hope someday I could give something to this "community which has given you and me so much"...
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#15899 - Lord Graga - Tue Feb 03, 2004 11:22 am

I love that tutorial. It covers compression, which is something that I really want to use in my games, etc. It's really well written, because a routinated GBA programmer (not newbie) can understand what you write fully, in a flash, unlike The Pern Project, which has a lot of "why it is like that" stuff, which is not bad for newbies, but slower to read for routinated coders that needs a couple of bits'n'pieces.


Well done!

#15901 - RaBBi - Tue Feb 03, 2004 12:14 pm

Entirely agreed with Lord !

Furthermore, I believe I read that headspin is a professionnal developper, so it's well clarified for a professional explanation ^^
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^

#15904 - gb_feedback - Tue Feb 03, 2004 4:48 pm

A very nice and clear tutorial. I like the use of pictures to clarify code organisation. It works well.

One thing; I think that your copy of Burton Radons' code has a bug. I was pestering Burton to fix a problem which caused my Photoshop jpegs to be badly corrupted, and he mailed me an improved version, which then didn't seem to make it to his site. The problem relates to Restart Intervals. I don't think that the images Burton was working with included such segments.

At any rate I have put up the version he sent me at http://www.mqp.com/fun/gba-jpeg.zip, where it will be for a few days. You may like to compare the .c file looking for 'restart', and the dates on the files. If it's not a later date than yours I've put the wrong one up.
_________________
http://www.bookreader.co.uk/

#15905 - headspin - Tue Feb 03, 2004 5:58 pm

Thanks for the positive feedback guys!

RaBBi: Actually I'm not a professional, just a home developer :)

Lord Graga: Glad you like the tute. I like to get to the point in the tute, without getting into too much technical details since they can be worked out by the coder or in your case known much of it already. I've actually played your mini-platform with the monkey & the cap. It's actually really cool and playable. I had that monkey run through that level about 10 times trying to perfect the jumping!

gb_feedback: Thankyou very much for posting the update really appreciate it. I've downloaded it have updated the tute. Cheers :)

#15906 - tepples - Tue Feb 03, 2004 6:21 pm

gb_feedback wrote:
I was pestering Burton to fix a problem which caused my Photoshop jpegs to be badly corrupted

Try running JPEG images through IJG's free Jpegtran if the GBA-side code won't open them. Jpegtran "normalizes" JPEG images to the bare minimum code and removes enhancements that baseline implementations can't handle, such as progressive display.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#15919 - gb_feedback - Wed Feb 04, 2004 10:24 am

Quote:
Try running JPEG images through IJG's free Jpegtran if the GBA-side code won't open them.

Yes, that may work if you can control what images are used. One of my applications was a jpeg viewer pogoshell plug-in where the user can potentially put any jpeg without preprocessing.
Does Jpegtran remove Restarts?

It's certainly a good idea to pre-process though, as a lot of these jpegs have thumbnails which can almost double their size. And the original pogoshell jpeg plug-in seemed to prefer to display the thumbnail if there was one present.
_________________
http://www.bookreader.co.uk/

#15923 - tepples - Wed Feb 04, 2004 3:42 pm

gb_feedback wrote:
Quote:
Try running JPEG images through IJG's free Jpegtran if the GBA-side code won't open them.

Yes, that may work if you can control what images are used. One of my applications was a jpeg viewer pogoshell plug-in where the user can potentially put any jpeg without preprocessing.

If you're going to accept user-submitted images with no preprocessing, then you'll need to handle at least progressive images and images larger than 240x160 pixels, as that's what I see most often on binaries newsgroups such as alt.binaries.pictures.fine-art.

Quote:
Does Jpegtran remove Restarts?

I think so. It reads in the DCT coefficients and then rewrites them with or without progressive and with or without restarts.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.