Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM2: I can't work out how to save and then load 8-bit graphics
Page 2 of 2 | |||||
Author | Message | ||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3801 |
In GIMP, you can select what's saved and which kind of BMP (or other image file format). John |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 368 |
Thanks Phil - you are 100% correct. There are two jump addresses in the BMP file header, one that specifies the location of the start of the pixel data, and another that specifies the size of the header (and therefore where the colour data starts). In my first cut off the code these were fixed lengths, because I was always saving all 256 colours. Then I realised that GIMP was doing something extra, so the latest version of the Load subroutine takes those two jump indexes into account and should now work for all 8 bit non-compressed BMPs. Thanks John. You are right, and I did select the non-compressed 8-bit format, but as mentioned above to Phil, I was being lazy/slack in my original implementation. The latest version takes into account the variable header sizes now. Right - that explains the weird effect I was seeing at the start of this thread. Thanks once again for being on top of all of this and for the ongoing support. It is always appreciated. |
||||
joker Newbie Joined: 06/02/2024 Location: GermanyPosts: 25 |
Hello, I'm new to this forum and I build my CMM2 end of November last year. I'm interested in bringing retro games to the CMM2. (See AirRescue) I stumbled upon the same issues with colormaps and if this thread would have been there one month earlier it had safed me a lot of time. Ñow some of my findings which I hope are an addition to this topic: 1. The clut of the microcontroller is a write only function. I wondered a bit that map() always return the same value for a speific entry until I found the remark in the user manual. But this I suppose you know already 2. To compensate that the clut cannot be read back, the firmware has stored a default colomap. This default map is used whenever a picture is loaded. Own modifications to the clut are ignored. Therefore, you cannot control the color register used 3. So the only way to load pictures with dedicated color indicees is 'load data" as already explained in this thread. 4. With gimp you can save a picture in "raw" format. This gives you the pure colors of the picture or the map indicates if your picture was indexed. But don't forget to delete the alpha channel. Otherwise you get two bytes per pixel. 5. I wrote a proxy library that allows me to maintain the colormap and also read the colors back. I hope this will give me the ability to unleash the power of indexed pictures. Sorry for the long text Matthias |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 368 |
A very warm welcome to the forum Matthias! And welcome to the wonderful world of the CMM2. I am also passionate about bringing retro games to the CMM2. It is the perfect platform for retro game design (IMHO), and balances just the right amount of power where incredible things are possible, but not always easy. In a world of desktop computers with almost unlimited graphics power - it's great to have to work on a system that requires old school techniques. The Load8BitBMP subroutine above will load the clut from the file format. But yes, when saving I had to "remember" the colours separately. I'm excited to see what you produce. Please share your progress here - it's always very interesting to see what others are doing with the hardware. |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3150 |
Indeed, welcome to the forum, and thanks for your contribution. I had never seen the word, "clut", before, so: Urban Dictionary: clut --CLUT is an acronym for "Color Lookup Table". CLUTs are also referred to as palettes. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
joker Newbie Joined: 06/02/2024 Location: GermanyPosts: 25 |
Hello, Thanks for the warm welcome. My first game on the CMM2 was Air Rescue (https://github.com/grimm-git/airrescue). It was also published beginning of 2024 on CMM2.fun. My current project is an interpretation of Fort Apocalypse. I name it "Fort Micromite" and first level is already playable. I think I will publish it as work in progress on Github the next days. It will use a custom palette with color cycling. Therefore, I was interested in this thread. Best Regards Matthias |
||||
Page 2 of 2 |
Print this page |