Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:18 01 Aug 2025 Privacy Policy
Jump to

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 : F4: why does one bmp image display but not the other

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:56pm 01 May 2021
Copy link to clipboard 
Print this post

For a deck of cards, I've converted bar1010's deck in CMM2 Concentration Game from PNG to BMP using PIXRESIZER.

The images display fine on my PC, but don't appear at all on the F4.

This is what PaintShopPro reports for image information--pixel depth 24:



If in PaintShopPro I reduce the color depth to 256 colors, the image displays as expected.



The manual indicates that a "24-bit true colour BMP file" should work. What is it about my first file which makes it not display? (I'll go through and reduce all 53 bmp files to 256 colors, but just wondering why the other didn't work.)

CLubsAce.zip
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 02:46pm 01 May 2021
Copy link to clipboard 
Print this post

Further confusion.

After I reduced the color depth in each file, they displayed fine on the F4, but were larger than I wanted. I resized them with GIMP. This is what they look like in Windows Explorer:



But this is what they look like when I display them on the F4 with the following code:
dim suit$(4)=("","C","D","H","S"), dr$="/cn/gr/", fn$=".bmp"
y=0: for i=1 to 4: x=10: for j=1 to 13: a$=dr$+str$(j)+suit$(i)+fn$: load image a$,x,y: x=x+55: next j: y=y+90: next i



Image files:
cards_gimped.zip

What is happening?

(PixResizer changes back to the non-displaying 24-bit BMP when I try to use that to resize.)


~
Edited 2021-05-02 00:52 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 02:59pm 01 May 2021
Copy link to clipboard 
Print this post

Something odd about the file, some bmp variant that isn't supported. Save it again with PSP as 24-bit and it works. The file is also much bigger than it should be 23K vs 17K (61*94)+ header.

Use something other than PIXRESIZER

Same issue on the CMM2 and therefore all MM variants
Edited 2021-05-02 01:01 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 06:21pm 01 May 2021
Copy link to clipboard 
Print this post

Thanks.

  matherp said  Use something other than PIXRESIZER


That's why I tried Gimp--to see if it would do better. The images displayed, but were shifted and included extraneous colors.

I resized again with PIXRESIZER to the final size I want, and again brought each file into PSP and reduced the color depth to 8 bits.

That worked:



Anyone have experience of another multi-file resizer I could try?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:44pm 01 May 2021
Copy link to clipboard 
Print this post

I don't care what PaintShopPro thinks, your original BMP file is 32 bit (24 plus alpha)
Windows file manager knows.

That is a common problem when converting from PNG to other formats.
One simple way to convert would be to use CMM2 to display the PNG then save as BMP.
Repeat for all files in the folder.

I don't have an easy way to bulk remove alpha.
For individual files, I open in Windows Paint and save as BMP. This gets you to 24 bit.
For bulk, I would probably write a program to do it.

Jim
VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 11:11pm 01 May 2021
Copy link to clipboard 
Print this post

Thanks, Jim--I never heard of 24 bits plus alpha, but I don't really know anything about BMP other that if I click on the file in Windows, an image pops up.

I tried an online multi-file resizer advertised as handling BMP files, but while you could select BMP files for input, it wasn't an output option.

I didn't reduce the color depth in GIMP. Maybe if I try again and do that when resizing, it will work with 8-bit color (which is all I need for cards--4 bit color would do).

I've used PixResizer for over a decade. It's too bad it doesn't have a color depth option for BMP files.

A little program on the CMM2 to cycle through the PNG files and save them as BMP would probably do the trick.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2640
Posted: 01:59am 02 May 2021
Copy link to clipboard 
Print this post

BMP cards.zip
IrfanView 4.53 has batch processing and can do almost any size / colour / type conversion. And it's free!
Tried to add the BMPs but not accepted so put them in a zip.
2021-04-25_163219_Concentration.zip
Edited 2021-05-02 12:22 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 06:45am 02 May 2021
Copy link to clipboard 
Print this post

  lizby said  
I didn't reduce the color depth in GIMP. Maybe if I try again and do that when resizing, it will work with 8-bit color (which is all I need for cards--4 bit color would do).

GIMP uses a newer version of the BMP header "BITMAPV5HEADER"
Most image programs save files with the older V1 header version. It looks like MMBasic doesn't like the V5 header.

Jim
VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 10:54am 02 May 2021
Copy link to clipboard 
Print this post

Thanks, Phil. I'll check out IrfanView.

And thanks, Jim. Always something new to learn--especially about how something new makes something old not work.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025