Creating an image editing application in Python
Asked Answered
B

4

6

I need a tile/sprite editor kind of like Pixen, but I couldn't find one for Windows so I thought it might be a good exercise for me to try and put one together. I use Python, so are there any libraries out there that are suited to the task of putting together a simple tile/sprite editor?

Beret answered 8/1, 2010 at 14:1 Comment(0)
S
2

So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k.

PIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI.

That's where the widgets toolkits come in: You would have to pick a toolkit platform that can offer you buttons, images, load and save the image files, maybe some specialzed widgets you can use to create your color swatches, etc. both GTK+ and QT4.5 have a liberal license, are very complete and very unpythonic on their use :-(

(While you are at it, when using these libraries and toolkits our app can easily be multiplatform: you don't have to make it windows specific, it is equally easy to create an app that will run on Windows, Linux and Mac using python and either GTK+ or Qt4)

One thing I would suggest is for you to learn to proper use GIMP: it is an Image editor, and certainly it will lack a lot of tools you are needing for sprites: but you can expand it's capabilities with Python plug-ins. On the other hand GIMP does have thousands of features that you'd no longer will need to create for your stand-alone app. (think on layer support, color filters, image rotation etc...)

Check around on how to install GIMP with Python support on Windows, then spend some hours learning the app, with some book-like text around preferably so you can find the hidden features.

Ah, ok, finally: If you want a very simple thing, just for the taste of "i did it" - you can use Pygame: You have to do all the drawing on the window, including text - but have straighter access to pixels, colors, mouse clicks and coordinates than with GTK+ or Qt, in a sense it would be a lot less of overhead for you to learn in terms of API's and internal working.

Splendid answered 8/1, 2010 at 17:26 Comment(2)
GIMP is awful. As someone once said on here, it's like Photoshop exploded and the result was GIMP. For UI advice, do the complete opposite of that awful piece of software. Paint.NET is a far superior choice.Ninnetta
@Dockers: which part of "learn to use it" in my answer did you miss? And its open nature allows it to be expanded with other needed features for sprite/pixel editing.Splendid
N
6

You just need a gui toolkit (gtk, qt, wx) a image library (PIL) and 500 hours of free time ...

Nanettenani answered 8/1, 2010 at 14:7 Comment(0)
F
3

Have you looked at the Python Imaging Library (PIL)?

Flied answered 8/1, 2010 at 14:2 Comment(1)
I have, but I don't know how to use them together :-/.Beret
S
2

So, the fact is that creating a complex app with a nice UI takes time - I am just expanding a little bit on the answer by THC4k.

PIL, at least PIL alone is useless for this: it does have some functions to manipulate images, but the complicate task here is creating and tunning your desired UI.

That's where the widgets toolkits come in: You would have to pick a toolkit platform that can offer you buttons, images, load and save the image files, maybe some specialzed widgets you can use to create your color swatches, etc. both GTK+ and QT4.5 have a liberal license, are very complete and very unpythonic on their use :-(

(While you are at it, when using these libraries and toolkits our app can easily be multiplatform: you don't have to make it windows specific, it is equally easy to create an app that will run on Windows, Linux and Mac using python and either GTK+ or Qt4)

One thing I would suggest is for you to learn to proper use GIMP: it is an Image editor, and certainly it will lack a lot of tools you are needing for sprites: but you can expand it's capabilities with Python plug-ins. On the other hand GIMP does have thousands of features that you'd no longer will need to create for your stand-alone app. (think on layer support, color filters, image rotation etc...)

Check around on how to install GIMP with Python support on Windows, then spend some hours learning the app, with some book-like text around preferably so you can find the hidden features.

Ah, ok, finally: If you want a very simple thing, just for the taste of "i did it" - you can use Pygame: You have to do all the drawing on the window, including text - but have straighter access to pixels, colors, mouse clicks and coordinates than with GTK+ or Qt, in a sense it would be a lot less of overhead for you to learn in terms of API's and internal working.

Splendid answered 8/1, 2010 at 17:26 Comment(2)
GIMP is awful. As someone once said on here, it's like Photoshop exploded and the result was GIMP. For UI advice, do the complete opposite of that awful piece of software. Paint.NET is a far superior choice.Ninnetta
@Dockers: which part of "learn to use it" in my answer did you miss? And its open nature allows it to be expanded with other needed features for sprite/pixel editing.Splendid
S
1

You could try PyGame but, seriously, you couldn't find a freeware graphics editor for Windows??!!

EDIT: In the past I've used Aha-Soft's IconXP for pixel work, but it costs USD 30 and doesn't offer all of the Pixen features that I guess you'll want.

Syncope answered 8/1, 2010 at 14:21 Comment(1)
No, I couldn't find a freeware graphics editor suited to making tiles/sprites for Windows, and by that I meant one that had features like that of Pixen's.Beret

© 2022 - 2024 — McMap. All rights reserved.