Author Topic: [XP] Bitmap2Code  (Read 7741 times)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20005
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
[XP] Bitmap2Code
« on: January 10, 2008, 04:06:20 PM »
Bitmap2Code
Authors: Blizzard
Version: 1.1
Type: Script Development Tool
Key Term: Scripting Tool

Introduction

Ever made a script, but you need to include several little image files for it to work? This is not necessary anymore! With the Bitmap2Code converter you can simply convert bitmap images into RGSS code. Instead of loading the file into the memory from a file, the bitmap will be generated via code.
This little script allows you to quickly load bitmaps converted to code with the Bitmap2Code.exe converter.

This work is protected by the following license:
Quote
Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
( http://creativecommons.org/licenses/by-nc-sa/3.0/ )

You are free:

to Share - to copy, distribute and transmit the work
to Remix - to adapt the work

Under the following conditions:

Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

Noncommercial. You may not use this work for commercial purposes.

Share alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

- For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

- Any of the above conditions can be waived if you get permission from the copyright holder.

- Nothing in this license impairs or restricts the author's moral rights.

Features

  • instead of loading image files, the bitmaps will be generated via code
  • optimizer recognizes same colors and optimizes generated code if possible
  • several quality options to simplify code by decreasing the number of colors
  • easy to use: set up the config file, copy the files, run the converter and just copy paste the generated code into your RGSS Editor
  • easy to implement into any script: just call RPG::Cache.load_code("NAME") instead of the usual bitmap loading methods

Screenshots

N/A for this type of script

Demo

N/A for this type of script. You can download the Bitmap2Code package and try it out, there are 3 example files within.

Script

Just make a new script above main and paste this code into it.
Script Download

Download this package with the .exe and 3 example images to see how it works. Note that this here is ACTUALLY THE CONVERTER! You need this converter in order to create codes for images. There is also a file with the script code from the link above.
Bitmap2Code package

Files included:
Bitmap2Code script.txt
Bitmap2Code.exe
Bitmap2Code.ini
Bitmap2Code.rgssad
Bitmap2Code_PKE.exe
Bitmap2Code_PKE.ini
Bitmap2Code_PKE.rgssad
black_box.png
Config.ini
map_indicator.png
movie_stripes.png
readme.txt
result.txt

Instructions

Download the Bitmap2Code package and read the readme.txt.

Compatibility

Does not load normal resource image files. Easy to implement into any script. 90% chance of full compatibility with any SDK.

Credits and Thanks

  • Blizzard

Author's Notes

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! Enjoy! =D
« Last Edit: February 21, 2009, 12:40:32 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Bitmap2Code
« Reply #1 on: September 19, 2009, 08:53:51 PM »
This is the biggest grave dig ever and I've read the instructions repeatedly and I just dont understand them or understand how to use this, I do however understand what it does I just dont know how to use it >_>

Hey look! Its a bird, No its a plane!

Wait nvm its just that big failure G_G

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Male
  • Wants to write a compiler for fun
    • View Profile
Re: [XP] Bitmap2Code
« Reply #2 on: September 19, 2009, 09:33:02 PM »
basically G_G, the bitmap2code.exe takes a picture and then creates a .txt file that has the needed code to generate the image through script.
you simply open the bitmap2code.ini file and use the tags in the readme to tell it which images to convert and how to do the conversion
then you would use RPG::Cache.load_code(file) to retrieve the bitmap that is the image you converted where 'file' is the name of the txt file.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Bitmap2Code
« Reply #3 on: September 20, 2009, 04:32:04 AM »
okay that makes more sense, thanks ryex, sorry blizz for gravedigging so far  :twitch:

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20005
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Bitmap2Code
« Reply #4 on: September 20, 2009, 11:11:45 PM »
No problem. One of the purposes of this threads is to get questions answered after all.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.