November 22, 2024, 05:28:19 am

Author Topic: A Tool for Sprites  (Read 4926 times)

0 Members and 1 Guest are viewing this topic.

matt88222

  • Gears of War 3
  • Full Member
  • *
  • Posts: 185
  • Hi I'm Matt
    • View Profile
A Tool for Sprites
« on: July 29, 2011, 12:34:23 am »
So a while back I made a little tool to assist in the creation of sprites.  I've decided to share it here with everyone with the small chance that someone finds it useful.  If enough people get some use out of it I may try to update it on suggestions ;)

Link: http://uppit.com/wzc5psa98um2/Minecraft_Image_to_Text.jar

Funcion: So what does this program do anyways? Basically it'll take an image that was converted to use only colors available in Minecraft (Using a photo editing program such as GIMP or Photoshop and a palatte) and display all of the colors in a text file.  See: http://www.opticraft.net/index.php/topic,2085.0.html on how to do that!  Once the image has been converted it is to be saved as a .ppm file (GIMP allows this, I'm assuming Photoshop does as well!)

Please note, when you save the .ppm file you MUST save it in Ascii form, not Raw form!

Usage:

What you'll need:
  • The image you wish to convert (Saved as a .PPM)
  • A palatte file you used to convert the image (For now, only .gpl files work!)

So, once you've downloaded the .jar file, simply double click it to run the program. (If the program does not start for some reason, try right-clicking it and selecting "Open With -> Java"

1.) Read the description then press "OK"
2.) Read the prompt, press "OK"
3.) Select the .gpl file you used to convert the image.
4.) Read the prompt, press "OK"
5.) Select the .PPM file you'll be using.
6.) Read the prompt, press "OK"
7.) Choose the name and location of the .txt file that will be created.  Click Save
8.) Finished :)


The .txt file created will have a key at the bottom.  Each row of the text file corresponds to one line in the sprite.  The last line in the text file is the bottom of the sprite, the first line the top.  Simply read each line left to right and place the blocks of that row left to right.

For Example: A sprite like this:
BBBBB
BBBBB

Would be a text file like this:

Code: [Select]
Red, Green, BlueX2, Red
Blue, Green, RedX3

The point of this program is to (hopefully) make things a bit easier than trying to click on the colors with a color selector tool to see what they are and switching back and forth between your image editor and minecraft.  Yes, I know there are other ways of using image editors (Selecting all pixels of once color and doing them all at once) but this just offers an alternative method.

Let me know what you think :)
« Last Edit: July 29, 2011, 08:56:58 pm by matt88222 »

grand_chill

  • Alone
  • Sr. Member
  • **
  • Posts: 381
  • It's a Trap!
    • View Profile
Re: A Tool for Sprites
« Reply #1 on: July 29, 2011, 12:44:53 am »
Interesting, i used this method for some sprites i have done before so ill give this a go when im home in 2 days  ;)

JKA

Mr.Monkey

  • Nomnom
  • Hero Member
  • **
  • Posts: 575
  • 2D artist
    • View Profile
    • minecraft pictures
Re: A Tool for Sprites
« Reply #2 on: July 29, 2011, 06:08:47 pm »
Tool works fine, except that the output textfile is empty...
« Last Edit: July 29, 2011, 06:23:31 pm by Mr.Monkey »

Spoiler (click to show/hide)

matt88222

  • Gears of War 3
  • Full Member
  • *
  • Posts: 185
  • Hi I'm Matt
    • View Profile
Re: A Tool for Sprites
« Reply #3 on: July 29, 2011, 07:37:13 pm »
Tool works fine, except that the output textfile is empty...

:o

Hmm, mind giving me the files you tried to use it with? (Either here or in PM)
Really strange that this would happen :\

Mr.Monkey

  • Nomnom
  • Hero Member
  • **
  • Posts: 575
  • 2D artist
    • View Profile
    • minecraft pictures
Re: A Tool for Sprites
« Reply #4 on: July 29, 2011, 08:27:41 pm »

Spoiler (click to show/hide)

matt88222

  • Gears of War 3
  • Full Member
  • *
  • Posts: 185
  • Hi I'm Matt
    • View Profile
Re: A Tool for Sprites
« Reply #5 on: July 29, 2011, 08:56:07 pm »
Ahh crap I'm an idiot! :P

I forgot to mention that when you save the .ppm file, you need to save it as ASCII, not RAW.
(It should pop up giving you the option when you save the file.)

omaroo2

  • OptiCraft's Pharaoh.
  • Hero Member
  • **
  • Posts: 927
  • PSN: UnlimitedEra Steam: UnlimitedEra
    • View Profile
Re: A Tool for Sprites
« Reply #6 on: July 31, 2011, 03:51:53 pm »
cool tool , ill use monkey's color Platte , thanks for sharing.


grand_chill

  • Alone
  • Sr. Member
  • **
  • Posts: 381
  • It's a Trap!
    • View Profile
Re: A Tool for Sprites
« Reply #7 on: August 01, 2011, 07:31:36 am »
Tried it, it works (i think) but in the txt file it only has seven lines of text instead of however many there should be, and there are a bunch of S, L and W's in these brackets [ ] what do they mean and how do i know where a new line is? cause there is a lot more than 7 lines.

JKA

matt88222

  • Gears of War 3
  • Full Member
  • *
  • Posts: 185
  • Hi I'm Matt
    • View Profile
Re: A Tool for Sprites
« Reply #8 on: August 01, 2011, 07:39:23 am »
Tried it, it works (i think) but in the txt file it only has seven lines of text instead of however many there should be, and there are a bunch of S, L and W's in these brackets [ ] what do they mean and how do i know where a new line is? cause there is a lot more than 7 lines.

Thanks for trying it out :)

At the bottom of the text file, a key should have been printed that explains the whole S L W thing.  I'll add it here as well though :)

Code: [Select]
[S] - Shadow
[L] - Leaf
[W] - Water



Now, as far as the text file being only 7 lines, that's strange.  I'm assuming the picture you're trying to use has a height larger than 7 :\

Mind uploading the files used either here or in PM?  Maybe I can see what went wrong.