Author Topic: 32-bit bmp converter  (Read 1611 times)

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 6899
32-bit bmp converter
« on: November 12, 2019, 01:23:41 PM »
With Windows 7 support ending soon I have decided it is finally time to switch to Windows 10. So over the last few days I backed everything up and then clean installed 10 and my main programs. Its all gone reasonably well except that I can no longer use the old copy of Photoshop Elements that I got free with an Intuos tablet years ago. The only thing I used it for is converting 24-bit bmps to 32-bit bmps for AH diffuse and normal maps, for everything else I use Paintshop Pro. Now the latest version Elements 2020 costs over £86 and the full version is a subscription service. The free version of Photoshop Skuzzy used to champion seems to have gone away and apparently doesn't work well with Windows 10 anyway. I don't really want to pay so much for a program I will barely use so I have been looking for free or cheap alternatives.

Before I changed to Windows 10 I tried out Gimp for doing this, as I had realised I might not be able to use Elements. It did seem to work as well, the bmp file size went up 25% as it should and I left it at that  without viewing the file in the viewer or game. Unfortunately I now realise that in Gimp this feature seems to be bugged. The 32-bit bmps it produces can be read by the game but are offset to the right making the skin look rubbish. There is a save option to remove header information and that does reduce this offset, but it does not get rid of it completely. So it looks like Gimp is corrupting the image header somehow and is therefore useless for this job.

I have been experimenting with the editor Krita but this does not have an option to save as a 32-bit bmp. There may be some way to change the file's bit depth or give the bmp an alpha channel and then save it that way, but if there is I haven't figured it out yet.

I also tried a couple of other programs Irfanview and Inkspace, but they can't do it either. There's a whole load of other free editors and file viewers out there but I'm concerned about malware with this sort of thing.

So what is everyone else using for 32-bit bmp conversion these days?

« Last Edit: November 12, 2019, 01:26:39 PM by Greebo »

Offline Vraciu

  • Plutonium Member
  • *******
  • Posts: 13874
Re: 32-bit bmp converter
« Reply #1 on: November 12, 2019, 02:12:06 PM »
I use an older version of GIMP.   I merge all layers in Paint Shop Pro, then add one layer with nothing on it and save as a Psp file.   I open that in GIMP and save at 32-bit.
”KILLER V”
Charter Member of the P-51 Mustang Skin Mafia
King of the Hill Champ, Tour 219
325th VFG - "The Checkertails"
King of the Hill Win Percentage - 100 (1 Win, 0 Losses)

Offline Devil 505

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 8747
Re: 32-bit bmp converter
« Reply #2 on: November 12, 2019, 02:27:45 PM »
Greebo, in Gimp, when you save as a .bmp are you selecting "Flatten Image" or "Merge Visible Layers"?
Kommando Nowotny

FlyKommando.com

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: 32-bit bmp converter
« Reply #3 on: November 12, 2019, 03:28:41 PM »
Paint.Net now has native 32bit support along with 24bit files BMP and PNG. I'm using it to create 32bit reticles for PlanetSide 2. It may be good enough to do the conversion you want.
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline TequilaChaser

  • AH Training Corps - Retired
  • Plutonium Member
  • *******
  • Posts: 10166
      • The Damned - founded by Ptero in 1988
Re: 32-bit bmp converter
« Reply #4 on: November 12, 2019, 06:01:59 PM »
Paint.Net now has native 32bit support along with 24bit files BMP and PNG. I'm using it to create 32bit reticles

I was going to suggest trying Paint.Net

Good suggestion Bustr....
"When one considers just what they should say to a new pilot who is logging in Aces High, the mind becomes confused in the complex maze of info it is necessary for the new player to know. All of it is important; most of it vital; and all of it just too much for one brain to absorb in 1-2 lessons" TC

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10873
Re: 32-bit bmp converter
« Reply #5 on: November 12, 2019, 06:45:11 PM »
I'd be interested in hearing what Devil has to say about "Flatten Image" and "Merge Visible Layers" and comparing them to "New Layer from Visible".

Using GIMP is not a great option but I can make GIMP export a good (I can't tell if it isn't) normal map and with a little effort, as in New Layer from Visible, then Ctrl+A, Ctrl+C, Shift+Ctrl+V (for pasting into a new image); remove alpha, convert to grayscale and export.

My problem is exporting a version 3.0 bitmap (256 color) directly from GIMP. I use i_view32 for that conversion from the same company Greebo mentioned above after exporting from GIMP as a 32 bit bitmap.

I see the same shifting of the images exported from GIMP when I'm skinning a square tile for a custom field or city. In my case, I must ensure to use a 256 indexed color bitmap.

I hope Devil has some hints for us both.
Easy in-game again.
Since Tour 19 - 2001

Offline Vraciu

  • Plutonium Member
  • *******
  • Posts: 13874
Re: 32-bit bmp converter
« Reply #6 on: November 12, 2019, 07:09:12 PM »
I have no problems with GIMP using my method.   If I try to import a PSP file with more than two layers I see weird stuff like you guys are saying.   

With PSP I merge all layers, add one layer with no info, and save as p51d.psp (my master files have different names).    I then open that file in GIMP and save as a 32-bit BMP file.   It’s a workaround but it does the job. 
”KILLER V”
Charter Member of the P-51 Mustang Skin Mafia
King of the Hill Champ, Tour 219
325th VFG - "The Checkertails"
King of the Hill Win Percentage - 100 (1 Win, 0 Losses)

Offline Devil 505

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 8747
Re: 32-bit bmp converter
« Reply #7 on: November 12, 2019, 07:36:03 PM »
I'd be interested in hearing what Devil has to say about "Flatten Image" and "Merge Visible Layers" and comparing them to "New Layer from Visible".

Using GIMP is not a great option but I can make GIMP export a good (I can't tell if it isn't) normal map and with a little effort, as in New Layer from Visible, then Ctrl+A, Ctrl+C, Shift+Ctrl+V (for pasting into a new image); remove alpha, convert to grayscale and export.

My problem is exporting a version 3.0 bitmap (256 color) directly from GIMP. I use i_view32 for that conversion from the same company Greebo mentioned above after exporting from GIMP as a 32 bit bitmap.

I see the same shifting of the images exported from GIMP when I'm skinning a square tile for a custom field or city. In my case, I must ensure to use a 256 indexed color bitmap.

I hope Devil has some hints for us both.

I don't have much info to give and I'm not even sure if it's relevant to Greebo's problem. But when AH3 first launched, I was having trouble with getting 32 bit .bmp's displaying in the game. The colors were shifting 1/3 a rotation of the color wheel, if you will. Reds became blue, blues became yellow and so on. When I was making skins in AH2, I would select "flatten image" when saving as a .bmp and then chose the "X8 R8 G8 B8" 32 bit encryption(or whatever it really is) because the other  - A8 R8 G8 B8 was not available. This was not an issue in AH2 but created the problem in AH3. I figured out that to save a 32 bit .bmp with A8 R8 G8 B8 encryption, I had to select "Merge Visable Layers" and that A8 R8 G8 B8 was the default using that method.
Kommando Nowotny

FlyKommando.com

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10873
Re: 32-bit bmp converter
« Reply #8 on: November 12, 2019, 07:42:09 PM »
I'll try some variations on that and see if it helps with my work.
Thanks!

 :cheers:
Easy in-game again.
Since Tour 19 - 2001

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 6899
Re: 32-bit bmp converter
« Reply #9 on: November 13, 2019, 03:08:08 AM »
Thanks for all your replies guys, I'll give Paint.Net a try.

I wasn't aware I could load my PSP working file into Gimp so the flatten image issue hasn't come up for me yet, I'll give that a try if Paint.Net doesn't work. What I have been doing with Gimp is pretty much the same thing I was doing with Photoshop Elements. In PSP I save a copy of the working file as a 24-bit bmp and then load this bmp into Gimp. In Gimp I open the "Export as" dialog, select the file and in the subsequent "Export Image as BMP" dialog select the 32-bits X8 R8 G8 B8 option. I also tried adding an alpha channel to my bmp in Gimp and then saving using the A8 R8 G8 B8 option, but this made no difference. Saving it with and without the "Do not write color space information" box ticked gives the differing but still incorrect results seen below:-



In the LH shot is what the skin looks like as a 24-bit (or 32-bit Photoshop) bmp, the middle shot is what Gimp does to it with the color space box un-ticked and the RH one is with it ticked. Its like the whole image has been shifted to the right except that when I view these Gimp-modded files in a viewer they aren't shifted at all. Paintshop Pro complains that these Gimp-modded bmps are corrupt and won't open them yet it will open my previously Photoshop-modded 32-bit bmps. I think Gimp is doing something to the bmp's header that some programs (like the Windows viewer) can accept and other programs (like AH and PSP) can't.
« Last Edit: November 13, 2019, 03:22:42 AM by Greebo »

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 6899
Re: 32-bit bmp converter
« Reply #10 on: November 13, 2019, 04:03:23 AM »
OK I just tried Paint.Net and it does allow me to save my 24-bit bmp as a 32-bit bmp. Unfortunately this then does exactly the same thing to the skin in the AH viewer as Gimp did in the middle screenshot above. So perhaps the issue is not so much how Gimp and Paint.Net work but in how AH reads bmp headers? The only difference is that PSP will open the Paint.Net modded-file. A quick web search revealed that Gimp defaults to version 5 of the bmp format so perhaps AH is trying to read an earlier format? Maybe I should ask HT to take a look at this thread to see what he thinks. In the meantime I'll try to reproduce Vraciu's and Devil's workflows with Gimp.
« Last Edit: November 13, 2019, 04:06:09 AM by Greebo »

Offline Vraciu

  • Plutonium Member
  • *******
  • Posts: 13874
Re: 32-bit bmp converter
« Reply #11 on: November 13, 2019, 07:22:25 AM »
Thanks for all your replies guys, I'll give Paint.Net a try.

I wasn't aware I could load my PSP working file into Gimp so the flatten image issue hasn't come up for me yet, I'll give that a try if Paint.Net doesn't work. What I have been doing with Gimp is pretty much the same thing I was doing with Photoshop Elements. In PSP I save a copy of the working file as a 24-bit bmp and then load this bmp into Gimp. In Gimp I open the "Export as" dialog, select the file and in the subsequent "Export Image as BMP" dialog select the 32-bits X8 R8 G8 B8 option. I also tried adding an alpha channel to my bmp in Gimp and then saving using the A8 R8 G8 B8 option, but this made no difference. Saving it with and without the "Do not write color space information" box ticked gives the differing but still incorrect results seen below:-

(Image removed from quote.)

In the LH shot is what the skin looks like as a 24-bit (or 32-bit Photoshop) bmp, the middle shot is what Gimp does to it with the color space box un-ticked and the RH one is with it ticked. Its like the whole image has been shifted to the right except that when I view these Gimp-modded files in a viewer they aren't shifted at all. Paintshop Pro complains that these Gimp-modded bmps are corrupt and won't open them yet it will open my previously Photoshop-modded 32-bit bmps. I think Gimp is doing something to the bmp's header that some programs (like the Windows viewer) can accept and other programs (like AH and PSP) can't.


You may need to try an older version of GIMP. 

Make sure you are merging all your visible layers in Paintshop FIRST.    Then add a new layer and save under a different file name (I usually do this first so I don't overwrite by mistake).    You then take this two-layer PSP file and open in GIMP to save as a BMP using the options Devil mentioned.     It should work fine.

When I tried the latest version of GIMP I still had issues as I recall.    Went to an older version and it works like it should.  It still doesn't like more than the two-layer method for PSP files, though.
”KILLER V”
Charter Member of the P-51 Mustang Skin Mafia
King of the Hill Champ, Tour 219
325th VFG - "The Checkertails"
King of the Hill Win Percentage - 100 (1 Win, 0 Losses)

Offline Greebo

  • Skinner Team
  • Platinum Member
  • ******
  • Posts: 6899
Re: 32-bit bmp converter
« Reply #12 on: November 13, 2019, 07:42:48 AM »
Thanks Vraciu, this does seem to point to AH not recognising the latest version of the bmp format. I was successfully using an old copy of Photoshop and you are still using an old copy of Gimp while the two up-to-date programs I have tried have both produced the same error.

I found this BBS thread from three years ago where we last discussed this issue. At the time you and Devil were both using Gimp 2.6. is that what you are still using? The earliest version on the official site seems to be 2.8, if that won't do the job I'll have to go to a third party site to get 2.6 which I am loathe to do.

Offline Vraciu

  • Plutonium Member
  • *******
  • Posts: 13874
Re: 32-bit bmp converter
« Reply #13 on: November 13, 2019, 07:45:21 AM »
I use PSP 4 and I believe you are correct regarding GIMP 2.6 but I can't confirm until I get back home.    Hopefully Devil can weigh in.
”KILLER V”
Charter Member of the P-51 Mustang Skin Mafia
King of the Hill Champ, Tour 219
325th VFG - "The Checkertails"
King of the Hill Win Percentage - 100 (1 Win, 0 Losses)

Offline Devil 505

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 8747
Re: 32-bit bmp converter
« Reply #14 on: November 13, 2019, 09:02:06 AM »
yes, I'm still using Gimp 2.6
Kommando Nowotny

FlyKommando.com