Jump to content

bmp issue


PEB14

Recommended Posts

captur10.png

The image is cut by a red line and part of the right side is transferred to the left side! Is think the issue is well known but I cannot find the whereabout…

(Obviously the image file is read perfectly with any image viewer other that CMFI…) 😡

Edited by PEB14
Link to comment
Share on other sites

16 minutes ago, IanL said:

Oh yeah CM uses a specific BMP encoding. I do not remember the specifics of the top of my head but your editing software needs to make a tweak to those settings on save for CMFI to be happy. Viewers and editors can handle a wide range of encoding.

I remember that it shall be encoded in 24-bit but apart from that…

Link to comment
Share on other sites

10 hours ago, Ivan Zaitzev said:

What I usually do is save the image as PNG, then make a copy of an original BMP from the game, edit the copy in paint and paste the PNG over it. Then I rename the file. Works every time.

Sounds great but unfortunately it doesn't work for me! 🤯

I really don't understand the issue. When I created a first test scenario I loaded a greyscale bmp pic using Gimp it worked perfectly (once the 24-bit issue was sorted). Now I tried with two different images and the same encoding options and it either shows the red line stuff… or crashes the game to desktop!

That's the kind of silly thing that drives me crazy. Losing time on such a basic task is just plain stupid, it's as many time lost for optimizing the map or refining AI plans. :angry:

By the way I'm working on a Mac, and my pictures tools are either "Preview" or Gimp. I'm able to create excellent overlays with Gimp and not a stupid 170x170 bmp pic? Naah…

Link to comment
Share on other sites

7 minutes ago, PEB14 said:

Unfortunately paint.net doesn't run on Mac.

Anyway I can't understand how a bmp made using Gimp does perfectly work once, while another done the very same way shows the red line stuff. That's beyond my understanding.

Well, I don't know if you have any experience in software development. If you don't, you'll probably not believe how often I get to hear "It used to work and I haven't changed anything - that is related to this issue." 😉

So, this begs the question: In what way are the new pics different than the one that worked? (size, color range, etc.) Also, does it still work with a) your old picture and b) with exactly the same picture but done again (maybe there was an update in between?)

Link to comment
Share on other sites

37 minutes ago, Butschi said:

Well, I don't know if you have any experience in software development. If you don't, you'll probably not believe how often I get to hear "It used to work and I haven't changed anything - that is related to this issue." 😉

No I don't. But I'm working with computer scientists that are making me regularly mad, as they tend to change things that were working fine into things that don't work as good anymore - or that doesn't work at all ! Looks like a computer science trademark. 😈

 

37 minutes ago, Butschi said:

So, this begs the question: In what way are the new pics different than the one that worked? (size, color range, etc.) Also, does it still work with a) your old picture and b) with exactly the same picture but done again (maybe there was an update in between?)

My good'ol pic still worked fine when I tested it this morning. So I just followed your advice, loaded it into gimp, and just saved it. Now it crashes CMFI to desktop. (Obviously I didn't change gimp version since ages so no idea what has changed…)

If you wanted to get me crazy then go on, you're on the right track… 🙃

 

Link to comment
Share on other sites

On 4/28/2023 at 12:25 PM, PEB14 said:

I'm working with computer scientists that are making me regularly mad, as they tend to change things that were working fine into things that don't work as good anymore - or that doesn't work at all

Some super duper irony here because BFC have essentially stuck with a format that worked good enough and never changed it and now since they did not keep up with the latest puff of wind you (we) have trouble picking the right flags and bits to get the image to work for us. :D

With that joke aside I'll try to actually add something worth checking: Could it be an image size issue 171x170 is not rejected but also not handled correctly?

Link to comment
Share on other sites

19 minutes ago, IanL said:

Some super duper irony here because BFC have essentially stuck with a format that worked good enough and never changed it and now since they did not keep up with the latest puff of wind you (we) have trouble picking the right flags and bits to get the image to work for us. :D

With that joke aside I'll try to actually add something worth checking: Could it be an image size issue 171x170 is not rejected but also not handled correctly?

Well you're half correct on this joke: bmp has never been a super format, IIRC essentially a Microsoft stuff while Apple pushed for the tiff format. That's why I'm having issues basically, using Apple stuff. As 95% of the users are on Windows I guess it's indeed not a problem…

But you're totally correct: BFC stayed with a format that is getting pretty old; the game is getting as old as its players… 😆

As for the issue: thanks for asking. No, I've checked that it's not related to the pixel size. I've even been much surprised to find stock scenarios with more than 170 pixels in one dimenension… and it works!!!!

Link to comment
Share on other sites

5 minutes ago, PEB14 said:

As 95% of the users are on Windows I guess it's indeed not a problem…

Well things don't always work first try for us Windows users either. For my icon mod I used a simple icon editing tool but it just could not save to the right format (32bit because transparency - IIRC) so I had to ditch it and switch to another one that could set the right flags when saving. Sigh.

My first attempt at a scenario icon was with Photoshop and whatever it chooses by default was not correct for CM either. I switched to Paint.Net and it just does what I need for scenario images. I am sure you can find the right tool with the right settings so that it works for you. Fingers crossed.

 

5 minutes ago, PEB14 said:

As for the issue: thanks for asking. No, I've checked that it's not related to the pixel size. I've even been much surprised to find stock scenarios with more than 170 pixels in one dimenension… and it works!!!!

Bummer I was hoping.

Link to comment
Share on other sites

1 minute ago, IanL said:

Well things don't always work first try for us Windows users either. For my icon mod I used a simple icon editing tool but it just could not save to the right format (32bit because transparency - IIRC) so I had to ditch it and switch to another one that could set the right flags when saving. Sigh.

My first attempt at a scenario icon was with Photoshop and whatever it chooses by default was not correct for CM either. I switched to Paint.Net and it just does what I need for scenario images. I am sure you can find the right tool with the right settings so that it works for you. Fingers crossed.

Working for hours on developping stuff (wether icons and scenarios), just to loose even more hours because of silly file formatting. How frustrating.😡

Anyway I'm confident: I do use Paint.net on my Windows computer.

Anyway, it's interesting that two of the most powerful graphics editors (Photoshop and Gimp) can't produce bmp compatible with CM! That's not far from being a bug!

Link to comment
Share on other sites

@kohlenklau has a special tallent to push me in the most positive sense! While his last idea regarding the bmp issue didn't work, it drove me on the way to the correct solution. Yeepee! 🥳

 

So here is the correct way to generate a CM-compatible bmp file with Gimp (it should also work with Photoshop):

- your image shall be in RGB colors mode

- dimensions shall be 170 x 170 pixels or below

- bmp export shall be made using 24-bit encoding (this option you must chose in a box that opens when you export your file, see screen cap below).

- And,… and,... and… You MUST tickle the compatibility option of this same box (sorry it's in French in the screen cap, but it should say in English: "Do not write color space information"):

bmp10.png

You MUST tickle this option otherwise the file won't show properly when imported in CM.

I hope this will be helpful…

Link to comment
Share on other sites

19 hours ago, PEB14 said:

And,… and,... and… You MUST tickle the compatibility option of this same box (sorry it's in French in the screen cap, but it should say in English: "Do not write color space information"):

Nice. Mystery solved. And that actually makes sense with what you were seeing. The colour table is likely that red line and the image is therefore party offset because it is treating the colour table as image data (which it is not hence the red line) and therefore pushing the real image data over a little causing the goofy shifted part of the image.

That's my guess anyway.

BMP is a format with tons of variations and choices and improvements that were added over time. CM was written at the bare metal (as we programmers would say) with one and only one format of BMP supported. It just reads the file you hand it as if it were in that specific format. The advantage of this is there is no code to figure out what kind of file it's reading. They don't need it because the graphic authors know what the correct format is. That falls over when you let the public play with customizing images.

Sorry you spent so much time on fighting with this. I know how annoying it is when you just want to do a simple fun thing and you end up spending hours figuring out why that fun thing doesn't work. Sigh.

Link to comment
Share on other sites

Thank you @IanL

I think it would be great for such details to be included in the game manuals for reference purposes. That would save modders a lot of time.

(Same thing for the briefing txt file formatting, by the way).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...