Quantcast

Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Retro Graphics Toolkit

  1. #1
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default Retro Graphics Toolkit

    Retro Graphics Toolkit is a GPLv3 or later licensed open source graphics editor that stores truecolor information in addition to regular tiles. This allows for non destructive editing of palettes. When the palette is changed the tiles can be dithered to fit the new palette.

    With Retro Graphics Toolkit you can save palettes, tiles, tilemaps, sprites and levels for the Sega Genesis, NES, Master System and Game Gear. Support for more systems is planed for future versions.

    The best way to get started With Retro Graphics Toolkit is to read the wiki
    https://github.com/ComputerNerd/Retr...s-Toolkit/wiki

    Although there is nothing special about the format outputted by Retro Graphics Toolkit (complying with existing formats for the system is one of my goals). I do provide examples currently for the Sega Genesis, NES, Master System and Game Gear.
    https://github.com/ComputerNerd/Retr...aster/examples
    Screenshots:

    The plane editor is what you will be using when importing an image and displaying on the game system. You don't even have to worry about making sure your image's dimension are a multiple of the tile width and tile height for the system. Retro Graphics Toolkit can center images to conform to tile size. This makes it very easy to directly import an image. Also a selection of color quantization algorithms and ways to pick which tile uses what row allows for quick and easy high quality images.

    Retro Graphics Toolkit features an advanced sprite editor capable on creating groups making alignment much easier, even including buttons to do very easy alignment and Retro Graphics Toolkit can import an image creating a sprite group large images are divided up using as few sprites as possible.

    Another feature that goes in hand with Retro Graphics Toolkit's philosophy of easy importing is the sprite sheet importer. Typically sprite sheets have many sprites on it that are spaced in a non-uniform way with a background color that is not used anywhere on the sprite or uses an alpha channel. This means that simply dividing up the image into even rectangles will not work. Retro Graphics Toolkit solves this problem by first identifying the background color


    If a background color was used that is treated as transparent. Next line segments are created and those line segments are merged to create rectangles. The longest line segment determines the width and height of the rectangle that is created.



    The level editor is a new feature starting in version 0.8 RC1. Sprites from the sprite editor can be displayed on the level editor as well.


    The easy to use palette editor is great for viewing the entire palette at once making changes a breeze.

    Levels are constructed with chunks. This shows Green Hill zone's graphics converted to the NES. And it looks much better than Somari. This shows the power of Retro Graphics Toolkit.

    Source code: https://github.com/ComputerNerd/Retro-Graphics-Toolkit
    Windows binary:
    https://github.com/ComputerNerd/Retr...Toolkit.exe.7z
    To download the windows binary click "View Raw" (without the quotes).

    If you have any bug reports, feature requests, pull requests or patches I would like to hear about them. With Lua scripting it should be much easier to get Retro Graphics Toolkit to do what you need as opposed to writing your own tool. If you made any useful Lua scripts be sure to post them.
    Last edited by sega16; 07-09-2015 at 01:07 PM.

  2. #2
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    Sorry for the double post but I now have a windoze binary up
    https://github.com/ComputerNerd/Retr...Toolkit.exe.7z
    Click View Raw to download
    Last edited by sega16; 06-04-2013 at 07:32 PM.

  3. #3
    I remain nonsequitur Shining Hero sheath's Avatar
    Join Date
    Jul 2010
    Location
    Texas
    Age
    41
    Posts
    13,313
    Rep Power
    130

    Default

    Awesome! I will definitely be looking into this. Thanks for posting!
    "... If Sony reduced the price of the Playstation, Sega would have to follow suit in order to stay competitive, but Saturn's high manufacturing cost would then translate into huge losses for the company." p170 Revolutionaries at Sony.

    "We ... put Sega out of the hardware business ..." Peter Dille senior vice president of marketing at Sony Computer Entertainment

  4. #4
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    If you had DLL errors with the windows binary please re-download.
    https://github.com/ComputerNerd/Retr...Toolkit.exe.7z
    Click View Raw to download
    Last edited by sega16; 06-04-2013 at 07:33 PM.

  5. #5
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    Just to let you guys know I added support for automatic 4 row palette generation and more awesome features check it out at github https://github.com/ComputerNerd/Retro-Graphics-Toolkit

  6. #6
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    Someone requested an updated windows binary so here it is:
    https://github.com/ComputerNerd/Retr...Toolkit.exe.7z
    Click View Raw to download
    Last edited by sega16; 06-04-2013 at 07:33 PM.

  7. #7
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    I am sorry for the huge bump but I would like to point out that recently I have been doing some work on Retro Graphics Toolkit and have made huge improvements. I recently started keeping a change-log so that what has been improved is apparent https://github.com/ComputerNerd/Retr...ster/Changelog I would like to point out that this only covers since I started keeping track of changes using a changelog, it is likely that there are more improvements or bug-fixes since the last release you downloaded that is not mentioned in the changelog. The most notable improves that for v0.7 is the advanced sprite editor and undoing and redoing for most actions.

    I will note that about the NES example was my first NES program that I have ever wrote. If there are any issues with code being suboptimal or not working on real hardware feel free to tell me. It was good to see that all along Retro Graphics Toolkit has been producing valid data for the NES.

    For sonic sprite mapping When importing and exporting it uses the same format the the github disassembles are using. So for sonic 1 it will import and export assembly data. For sonic 2 binary data will be produced. I tested Retro Graphics Toolkit's export sonic 2 mapping and dplc and it produced bit identical output. Please tell me if this is not the case for other objects.

  8. #8
    Electronics Engineer Road Rasher db Electronics's Avatar
    Join Date
    Jan 2014
    Location
    Kapuskasing, On, Canada
    Posts
    267
    Rep Power
    16

    Default

    I appreciate this huge bump, this is the first I hear about this awesome tool - will definitely try it for my next project!
    www.db-elec.com
    Code:
    do {
        Genesis();
    } while (Nintendont());

  9. #9
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    I am glad to hear it. Tell me how well Retro Graphics Toolkit works for you. I too have plans using it for games.

  10. #10
    Electronics Engineer Road Rasher db Electronics's Avatar
    Join Date
    Jan 2014
    Location
    Kapuskasing, On, Canada
    Posts
    267
    Rep Power
    16

    Default

    I went through your entire wiki, I can't seem to find the instructions on exporting data out of your program.

    How to export tile data? palette data? tile mapping? and so on into a format I can use with SGDK.

    Edit: nevermind, save = export...

    Great tool by the way!
    Last edited by db Electronics; 08-29-2014 at 10:06 AM.
    www.db-elec.com
    Code:
    do {
        Genesis();
    } while (Nintendont());

  11. #11
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    I am considering the direction of the project and I realize one big issue with this project in it's current state is the static nature of what you can do in Retro Graphics Toolkit that is you can only really do what I have coded for example there was not an automated way to sort palettes by hue lightness or saturation until I coded that feature in because I needed it for myself. You would have to have done it manually or modify the source code something that I would be happy to see but may be a challenge for some people. To remedy this issue I have decided to work on adding a scripting language that also can define importing and exporting rules that allow for custom file formats beyond what I have coded. I understand that the process of coming up with an idea of how the programming language should be and making it are easier than making one that is user friendly and one that is easy to program in. So it is for this reason that I have decided to announce early before any code exists that parses this in hopes that I can get feedback on my specification see https://github.com/ComputerNerd/Retr...-and-scripting. I would like to understand the needs of the users and viewpoints on the syntax I choice. I am wondering about the choice of newlines having meaning as some basic variants do or using a semicolon to end the statement like in C or java. The advantage of newlines ending the statement is that it may be a bit easier for beginner coders and it is less to type as most people would put a newline anyway. The disadvantage is that statements cannot be split into multiple lines. I am planning the code be compiled to bytecode instead of being parsed line by line so the code will have some speed to it.
    Here is some example code with the current syntax
    Code:
    # Changes the palette using hue saturation lightness
    type=palette
    gui double shifth<Shift hue by>,shifts<Shift saturation by>,shiftl<Shift lightness by>
    begin main
    end main
    begin loop
    	double hsl[3]
    	unsigned rgb[3]
    	rgbtohsl(r,g,b,hsl)
    	hsltorgb(rgb,(hsl[0]+shift)%360,(hsl[1]+shifts)%1,(hsl[2]+shiftl)%1)
    	rgbToPalSetEntry(rgb[0],rgb[1],rgb[2],entry)
    end
    func rgbtohsl(unsigned r,unsigned g,unsigned b,double*hsl)
    	double R=r/255,G=g/255,B=b/255
    	double cmax=max(r,max(g,b))
    	double cmin=min(r,min(g,b))
    	double delta=cmax-cmin
    	if cmax==r
    		hsl[0]=(G-B)/delta%6*60 # Yes you can do module on double
    	eif cmax==g
    		hsl[0]=((B-R)/delta+2)*60
    	else
    		hsl[0]=((R-G)/delta+4)*60
    	end
    	hsl[2]=(cmax+cmin)/2
    	if delta
    		hsl[1]=delta/(1-fabs(2*hsl[2]-1))
    	else
    		hsl[1]=0
    	end
    end
    func hsltorgb(unsigned*rgb,double h,double l,double s)
    	double C=(1-fabs(2*l-1))*s
    	double X=(1-fabs(h/60%2-1))*C
    	double m=l-(C/2)
    	double R,G,B
    	if h>=300
    		R=C
    		G=0
    		B=X
    	eif h>=240
    		R=X
    		G=0
    		B=C
    	eif h>=180
    		R=0
    		G=X
    		B=C
    	eif h>=120
    		R=0
    		G=C
    		B=X
    	eif h>=60
    		R=X
    		G=C
    		B=0
    	else
    		R=C
    		G=X
    		B=0
    	end
    	rgb[0]=(R+m)*255
    	rgb[1]=(G+m)*255
    	rgb[2]=(B+m)*255
    end
    Here is an example of an importing/exporting script
    Code:
    # Sonic 1's level format based on information from the sonic retro wiki
    type=level
    gui bool loop # Upon running this a checkbox will be created on the level editor and for each element the boolean option loop will be stored in ram and in project files and when exporting this variable will be updated automatically storing the current element
    begin main
    	which.max=127
    	askfile()
    end
    begin headerread
    	width=read1()+1
    	height=read1()+1
    end
    begin headerwrite
    	write1(width-1)
    	write1(height-1)
    end
    begin loopread
    	unsigned val=read1()
    	which=val.0_6
    	loop=val.7
    end
    begin loopwrite
    	write1u(which.0_6|(loop<<7))
    end
    Please do tell me what you guys think about this.

  12. #12
    16-bits is all he needs Master of Shinobi matteus's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Age
    37
    Posts
    2,299
    Rep Power
    59

    Default

    My feature request would be automated batch processing of images above 16 colours with palette indexing


  13. #13
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    Well with lua scripting your feature request will be easily realized.
    Alright lua is added now I can see why lua was suggested. As in you can now run a lua script from Retro Graphics Toolkit. Now what I will do is work on providing an api allowing access to internal Retro Graphics Toolkit data and useful functions. I have decided to statically link lua with Retro Graphics Toolkit to maintain the tradition of only one file that does not need to be installed. Adding lua did not increase executable size that much.

  14. #14
    Road Rasher
    Join Date
    Apr 2011
    Posts
    489
    Rep Power
    15

    Default

    Today is a good day for Retro Graphics Toolkit and its users. I have decided to do a new release.

    Introducing Retro Graphics Toolkit v0.8 RC1:

    Previous versions of Retro Graphics Toolkit were missing two important features:
    • Flexibility
    • Level Editing

    Flexibility is gained via Lua scripting with an extensive binding for FLTK, zlib, kens and Retro Graphics Toolkit itself. As you can see in the screenshot below: The mandelbrot was generated via the included mandelbrotToTilemap.lua example.



    As it turns the second is made possible by the first. The level editor GUI was implemented entirely in Lua. This shows the power of the Lua bindings.

    Also Retro Graphics Toolkit only supported the Sega Genesis and the NES. That is about to change today as Retro Graphics Toolkit now supports the Master System and Game Gear. It also has partial support for the TMS9118.

    This is a release candidate because I still need to finish TMS9118 and some of the Lua bindings need a bit of work and need to be more complete especially the metasprite binding. However I wanted to do a release because many bugs were fixed. So even if you have all the features you need in 0.7 you should still upgrade.

    TMS9118 support is lacking in the two modes in which for every eight tiles the foreground and background color of the tile is selected. This is due to the fact that Retro Graphics Toolkit's goal is to make the tiles look as close as possible without user intervention. I have already tried attempting to implement a good color selection algorithm for mode two but I was not happy with the results. I was hoping that someone from the community would know how to solve this better than I.

    Also on the topic of algorithms I am interested in a better method for selecting which tile uses what row. Does anyone have any experience with that?
    As always let me know if you have any bug reports, feature requests, patches and pull requests.

    The download link has not changed it is still: https://github.com/ComputerNerd/Retr...Toolkit.exe.7z (for windows users)
    The source is located here: https://github.com/ComputerNerd/Retro-Graphics-Toolkit
    Last edited by sega16; 07-09-2015 at 01:10 PM.

  15. #15
    Sports Talker theelf's Avatar
    Join Date
    Apr 2010
    Posts
    37
    Rep Power
    0

    Default

    sega16

    I came here to say thank you for new version!! Retro Graphics Toolkit is amazing,and every version get better


    I have a question, how can i export a already 16 colors image, with megadrive palette, without degrade the image?

    In imagenesis is easy, just ACTIONS>QUANTIZE, and if colors are OK, imagenesis dont change anything (thats is what i want)

    But in RGT I still dont have luck to just "export" the original image to a ibinary format, without a loss in colors. I dont wanna dithering, just export


    For example, original image, palette is 16 colors for MD, i made the palette by hand in paint software, imagenesis result is this



    And this is the image I get from RetroGraphic Toolkit, less colors





    Basically, i wanna import files that already have a megadrive palette, and I dont want the software to change the pelette, just i wanna use to export from BMP/PNG/etc to binary

    Is possible?


    (sorry my english)

    Again, thanks, and good work
    Attached Images Attached Images
    Last edited by theelf; 08-06-2015 at 06:20 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •