Bitmap Export

Zeus81

Veteran
Veteran
Joined
Mar 17, 2012
Messages
164
Reaction score
150
First Language
French
Primarily Uses
Bitmap Export
by Zeus81
This script for rpg maker xp/vx/vxace allows you to export bitmaps as bmp32 or png32 image files.
This is a script for scripters so if you're not too bad but if you are feel free to use it.
It's probably the fastest script out there... well, maybe not as fast as those done in C but at least it have the advantage of not needing an extra dll.
I've also added functions so we can serialize bitmaps.

Script
https://www.dropbox.com/s/3lqtjvosnrnnet3/Bitmap%20Export.rb

How to Use
- exporting in bmp format :
bitmap.export('prout.bmp')
or
bitmap.save('prout.bmp')
Exporting in bmp is extremly fast, but not compressed.
Since it's bmp32 it also keeps alpha channel, however not many softwares can deal with it, I just know that RPG Makers and Gimp 2.6 can.

- exporting in png format :
bitmap.export('prout.png')
or
bitmap.save('prout.png')
png is compatible with almost anything and quite well compressed, but it takes a little more time, not that much either unless you're exporting a huge bitmap.

If you don't specify any extension when exporting .png will be added automatically.

- serialize bitmap :
open('prout.rxdata', 'wb') {|file| Marshal.dump(bitmap, file)}
bitmap = open('prout.rxdata', 'rb') {|file| Marshal.load(file)}
or
save_data(bitmap, 'prout.rxdata')
bitmap = load_data('prout.rxdata')
It's quite fast and as compressed as png but only compatible with this script, you can use it if you want to store picture directly into savestates.

- snapshot
Graphics.export('prout.png')
or
Graphics.save('prout.png')
or
Graphics.snapshot('prout.png')
This is a quick way to do a screenshot.
filename is optional, and will be replaced by datetime if omitted.
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
whoa now i only need a way to merge two or more image to one bitmap and then i could use it as character creation :D .
 

Zeus81

Veteran
Veteran
Joined
Mar 17, 2012
Messages
164
Reaction score
150
First Language
French
Primarily Uses
Quick update with version 5.1 :


- added #save alias name for #export


- added Graphics.snap_to_bitmap on rmxp


- added for quick snapshots :


Graphics.export(filename)


Still with alias name #save and #snapshot too.


filename is optionnal, and will be replaced by datetime if empty.
 

Palsa

General of Aurda
Veteran
Joined
Dec 21, 2012
Messages
343
Reaction score
84
First Language
English
Primarily Uses
Very cool script. ^_^

Question: can it be used to merge and export a group of Show Pictures with transparency?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Just blt a bunch of pictures together and export the resulting bitmap.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Just blt a bunch of pictures together and export the resulting bitmap.
That's awesome :)

This could be a very useful script, to use as an alternative to spending hours in a art program, trying to edit/splice together images perfectly. 

Cool script OP.
 
Last edited by a moderator:

Palsa

General of Aurda
Veteran
Joined
Dec 21, 2012
Messages
343
Reaction score
84
First Language
English
Primarily Uses
Just blt a bunch of pictures together and export the resulting bitmap.
K, at the moment I'm making some character busts and when I saw the script I thought it might be pretty cool to use it for an in game generator.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top