ENIGMA Forums

Contributing to ENIGMA => Proposals => Topic started by: TheExDeus on September 30, 2010, 12:47:11 pm

Title: Images
Post by: TheExDeus on September 30, 2010, 12:47:11 pm
I was messing round and found that LGM uses both, image alpha AND transparency color. Using both of them in the same time seems redundant and messy. I was going to suggest going the way GM8 did. Remove transparent attribute and everything that is connected to that. So have only alpha support and if someone wants to remove background color, then he just deletes that before importing (or in GM8 case, in the built-in editor). If <GM8 file is imported, then it checks if the transparency color is used, and if so, then just replaces the transparency color with 0 alpha. Its how GM8 does it.

Also, Enigma seem to save images in the exe using RGBA bitmap. So it takes a lot of space, shouldn't some compressed lossless format be used instead? Like .png? And what about Enigmas image file support? sprite_add seem to load only .bmp files. GM8 can load tens of formats as far as I know, and even if some of them are useless, I would love to use some. Like the stated .png. In every project I use external resources and for compression sake they are usually png and in some cases .jpg (where some quality loss is acceptable).
You could use some free C++ image library. Quick search revealed me http://cimg.sourceforge.net/. Although reading about I found it only supports 8 formats natively, and some of them are ASCII files. So I guess it can't be useful. It can be extended with (png's, jpges and lots of others) imagemagik. Some other project might be more useful thou.

Also, I know that LGM sprite functionality is far from finished (or is it?), but I must ask for some additions/changes to be made more prompt than others. For example, you can only select one image in the load dialog. This is something similar to GM, but it also has Add Image and Add from strip buttons, which allows selecting other files too. Because now I can't add an animation which consists of several .png images. I can only add one. The second problem is that I can't paste into new frames. So in GM I usually just pasted image from a graphics program every time I changed it. Like selecting one frame, and then pasting the image and it added the image after the selected frame. Then I deleted the old one and that was it. In LGM you can "Add new frame", but that just adds a white frame to the sprite. You can't modify it in any way (as far as I know).
Title: Re: Images
Post by: Josh @ Dreamland on September 30, 2010, 02:40:48 pm
@First paragraph
This is a bug I reported to Ism. Your paragraph contains exactly the same suggestion mine did.

@Second paragraph
The exe actually contains Zlib-compressed RGBA. Which is basically simplified PNG. You are correct that sprite_add only uses bitmap. I didn't want to incorporate sizey formats until I had a way of allowing the user to disable them. This will require such libraries as libPNG, libTIFF, and libJPG.

@Third
I'll leave that to Ism. Praps post a suggestion on the tracker; this forum is more for large system proposals.
Title: Re: Images
Post by: TheExDeus on September 30, 2010, 03:16:39 pm
Quote
@First paragraph
This is a bug I reported to Ism. Your paragraph contains exactly the same suggestion mine did.
Bug is that it "fills" the transparency color on load and thus leaving some ugly artifacts (as far as I understood). What I was suggesting is to remove the "transparent' tickbox, as well making the sprite_add function act more like in GM8 (no "transparency" argument, but "removeback"). Thou as the function itself isn't done yet, then I guess we don't need to think about that yet.

Quote
The exe actually contains Zlib-compressed RGBA. Which is basically simplified PNG. You are correct that sprite_add only uses bitmap. I didn't want to incorporate sizey formats until I had a way of allowing the user to disable them. This will require such libraries as libPNG, libTIFF, and libJPG.
Ok. So I will just have to wait and see. I could try incorporating libPNG and libJPG, but as I am not an official developer I better not. Maybe for my own personal use until its officially in. :)

Quote
I'll leave that to Ism. Praps post a suggestion on the tracker; this forum is more for large system proposals.
I will maybe add that ticket, but as I said, I guess lots of those parts are not ready, and if Ism wants to work on other, maybe more serious things, then we should let her.
Title: Re: Images
Post by: IsmAvatar on September 30, 2010, 03:25:42 pm
@First paragraph
The checkbox is retained for backwards compatibility during export. Alpha pixels are already handled smoothly (or if not, a bug report should be filed, because they worked fine last I tested them). As for your claim about artifacts, I'm not aware of this. One person was using LGM for down-converting a GM8 file to GM6 with images which already had partially transparent artifacts. This is largely unavoidable, and is really just a problem with the graphic artist, and not LGM.

@Third paragraph
The sprite editor is indeed far from being finished, and my dev team is down to 1 (myself), and my primary concerns at this time are largely ENIGMA interoperability.
As for the claim that you can't modify it in any way, this is entirely false. There is a properties file which specifies the image editor to use. By default, it is the Gimp. If you do not have the Gimp installed, attempting to edit the image will do nothing. You should modify the properties file to specify your own image editor, if you have one.
There was a move to create an image editor for LGM at one point, called JEIE, but the project never took off, and is just sitting there waiting for someone to develop it. A few people have taken interest, but nothing has come of it yet.
Title: Re: Images
Post by: TheExDeus on October 01, 2010, 04:46:21 am
Quote
The checkbox is retained for backwards compatibility during export.
Ou right. I forgot LGM allows saving to pre-GM8 file formats too. In that case there is no other way I guess.

Quote
There is a properties file which specifies the image editor to use.
I am not able to find that file. Do I need to create it if it doesn't exist?
Title: Re: Images
Post by: IsmAvatar on October 02, 2010, 07:39:01 pm
Quote
Ou right. I forgot LGM allows saving to pre-GM8 file formats too. In that case there is no other way I guess.
Technically we could do a similar thing, but backwards. If the image contains transparency, we simply set the transparency 'checkbox' (no longer there) to true and then figure out how to deal with the transparency. Of course, the hard part is figuring out how to deal with the transparency without dealing significant loss.

Quote
I am not able to find that file. Do I need to create it if it doesn't exist?
It's inside the jar. It should also be possible to create a file outside the jar to overwrite it. If not, that's functionality we intend to add.