support for image anti-aliasing

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
rohin
Newbie
Posts: 7
Joined: Fri Sep 14, 2007 7:07 am
Contact:

support for image anti-aliasing

#1 Post by rohin »

Hi, does Ren'Py support image anti-aliasing?

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: support for image anti-aliasing

#2 Post by monele »

It can antialias rotated and zoomed images if that's what you mean ô_o

rohin
Newbie
Posts: 7
Joined: Fri Sep 14, 2007 7:07 am
Contact:

Re: support for image anti-aliasing

#3 Post by rohin »

Thanks. I'm currently trying to remove some jagged edges from a character image and I thought anti-aliasing would be the way to go, but I'm not sure how to use it. My scene and character images are PNG files.

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

Re: support for image anti-aliasing

#4 Post by Alessio »

If the jagged edges are already in the original images, then no function can get rid of that - antialiasing is a function used in connection with image manipulation (such as resizing, rotating etc.).

yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

Re: support for image anti-aliasing

#5 Post by yummy »

I'd rather suggest you antialiase yourself the concerned frames with your image processor/manipulation tool. IIRC, there's such a function in Photoshop or the Gimp.
I understand it might be somehow different, but rather than relying on a tool to display exactly what you want it to display, wouldn't it be better if you tried to make it display what you already made? (I don't know if what I just wrote makes sense...)
For example, instead on counting on Ren'Py to antialiase, simply process the image and display them using Ren'Py. It's much much lighter and moreover faster to process than using the engine to process every frame (thus the use of zooms and rotozooms to make special effects isn't a real good idea using only Ren'Py because it costs a lot of memory).

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: support for image anti-aliasing

#6 Post by monele »

Big question to begin with : why are your pictures aliased? Do you draw them yourself? Tablet/scan? Which resolution?

rohin
Newbie
Posts: 7
Joined: Fri Sep 14, 2007 7:07 am
Contact:

Re: support for image anti-aliasing

#7 Post by rohin »

Sorry, I'm quite new to image manipulation tools and terminology. I extracted some character images from an existing visual novel game as bitmap files, so the transparency part was all one color that needed to be removed. I fixed the problem of the jagged edges by adjusted the radius to 4.0 for the "Feater edges" in gimp before selecting and removing the background color.

Thanks for your help guys! :mrgreen:

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: support for image anti-aliasing

#8 Post by monele »

Seems I found a way (on the web) to make this work better :
- Take your original picture (including background)
- Scale it up to 500%
- Use the magic wand (or anything you deem necessary) to select the background color. I'd suggest using 0 tolerance to only catch the background. Uncheck "antialiased" too.
- Select > Modify > Expand : 2 pixels
- Select > Modify > Smooth : 2 pixels
- Press the Del key to remove the whole selection
Hopefully, you should end up with only very slight remains of the background. If it's not enough, try to go back and Expand with 3 or 4 pixels if needed.
- Resize back to the original size (20%)

Zoom in and check the results. I just tried this on Ever17 sprites and it seems to work rather well, even if there are still some thin black edges (the background was black) around the character. But at least, they're *smooth* black edges ;).

I just tried another way to do it :
- Set the magic wand to Tolerance 50 (tweak that to your needs) and antialiased. The idea is that is selects the background and part of the mix between the background and the character. Then Del to remove all that, and resizing back to 20%.

Actually, the second technique seems to work better >.>...

Scott
Regular
Posts: 35
Joined: Thu Sep 13, 2007 6:11 am
Contact:

Re: support for image anti-aliasing

#9 Post by Scott »

The easiest way is to just extract them properly to begin with.

Alessio
Miko-Class Veteran
Posts: 576
Joined: Fri May 07, 2004 9:40 am
Completed: GO! Magical Boy (2006), Angelic Orbs (soundtrack)
Projects: Cyberlin (in progress)
Location: Finland
Contact:

Re: support for image anti-aliasing

#10 Post by Alessio »

"Color to alpha" in GIMP would probably yield a better result, since it creates gradual transparency, and at the same time removes even the slightest hints of the original background colour. For an explanation, look at the "Why Not a Selection" section at http://www.gimp.org/tutorials/Changing_ ... d_Color_1/.

rohin
Newbie
Posts: 7
Joined: Fri Sep 14, 2007 7:07 am
Contact:

Re: support for image anti-aliasing

#11 Post by rohin »

Alessio wrote:"Color to alpha" in GIMP would probably yield a better result, since it creates gradual transparency, and at the same time removes even the slightest hints of the original background colour. For an explanation, look at the "Why Not a Selection" section at http://www.gimp.org/tutorials/Changing_ ... d_Color_1/.
Thank you, that worked really well.

Post Reply

Who is online

Users browsing this forum: Google Adsense [Bot], Google [Bot], LuckyT, Majestic-12 [Bot], Toma