reducing bmp filesize query

Freeform discussion about anything related to modding Transcendence.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 817
Joined: Tue Nov 05, 2013 9:56 am

Tue Jul 16, 2019 3:39 am

While updating the CSC Olympus mod I converted the ship image from a 1 x 120 to 10 x 12 format. This is easier to view as it now isn't 50,000 pixels high!

Unfortunately on saving the bmp mask in this configuration the new file is massive. 50 or 70 MB.

Although I believe I have somehow reduced a file size of this format before successfully, I cannot remember how I did it.

Is there an easy way to save a bmp image with a much reduced file size but the same image size? jpg files are easily reduced but not bmps apparently. TIA.
Stupid code. Do what I want, not what I typed in!

User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1124
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Tue Jul 16, 2019 9:36 am

 If you have ImageMagick, try this:

Code: Select all

convert MassiveOlympusMask.bmp -alpha deactivate -threshold 1 -colors 2 -define format=bmp2 OlympusMask.bmp
 I’m assuming you’d be using the restructured Olympus mask as your input file with this. Testing with the 5920x7104 Executioner spritesheet from TBR, I got the mask down to 5.3MB with that command (working from a 29MB PNG with an alpha channel).

EDIT: Alternately, this should work:

Image
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 855
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

Tue Jul 16, 2019 9:06 pm

2 other ways to go about this:

You can convert the bitmask to an indexed (1-bit) image (or 8-bit if you need transparency). Using mspaint you can export it as a .bmp and select different bit depths from the export dropdown.

Alternatively, you can composite the mask and original image to convert it to a .png with full transparency. This takes a bit more knowledge of image editing though.
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
Real programmers count from 0. And sometimes I do, too.

relanat
Militia Captain
Militia Captain
Posts: 817
Joined: Tue Nov 05, 2013 9:56 am

Mon Jul 22, 2019 1:48 am

Success. Excellent. Many thanks.

Probably should have said what graphics programs I have available.
Mainly using Photoscape for ordinary graphics handling.
Irfanview for tricky stuff (tricky for me that is)
Paint for easy stuff.
I've got Gimp but usually can't work out how to use it.

My crowning achievement is a 32 x 32 pixel transparent white number '1' in png format. And it only took me three hours! :lol: It was easy after I tried using one of those alpha channel things even though I don't know what it is! :?


I have just downloaded ImageMagick. Thanks for the tip. Also apologies, I meant 12 x 10 in the converted image, same as the Transcendence images. I always mess up those x and y coords.


I couldn't find an "export" option on Paint (V5.1, very old) but I assume that "Copy To..." is the same thing. By using "Select All" then "Copy to..." and selecting a monochrome bitmap format the filesize was down to 3.3 MB (which is the same as AP's posted image). I tried re-exporting the 3.3 MB image hoping to get it down to sub MB size but it stayed at 3.3. This is about on par with the slightly smaller standard game image CSCHDMask.bmp which is 1.96 MB so that'll do for now.
Alternatively, you can composite the mask and original image to convert it to a .png with full transparency. This takes a bit more knowledge of image editing though.
This would be great. Given the huge number of image/masks already available that are used in Transcendence and mods this would make a really good step-by-step forum tutorial.
Last edited by relanat on Wed Jul 24, 2019 3:47 am, edited 1 time in total.
Stupid code. Do what I want, not what I typed in!

User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1124
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

Mon Jul 22, 2019 6:09 am

relanat wrote:I meant 12 x 10 in the converted image, same as the Transcendence images.
 I always do 10x12 on my stuff for technical reasons, so it never even occurred to me that you might have meant 12x10. I would have provided both versions if I’d thought of it. Glad you got something to work well enough to make it come out how you needed, though. ^.^
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)

Post Reply