Hey there,
To give you a little back story...
Or maybe I want to blur some bitmaps, but with more control than the regular blur option offers...
Apply a greyscale (black and white) effect...
Now as I am sure you can tell, there is quite a few things that could be done with effects such as this... The main problem is how long it takes to apply the effects. (some are much faster than others)
Anyway...
Basically, I am wondering if other script writers would actually use a script that offers such features?
Current methods :
Bitmap Class- brighten(amount=10)- brighten!(amount=10)- darken(amount=10)- darken!(amount=10)- invert- invert!- greyscale(scaler=3)- greyscale!(scaler=3)- sepia? # Not sure whether it looks right or not - randomize(times=2)- randomize!(times=2)- make_color(new_color) # recolors all white / grey to new_color- make_shadow_color(new_color) # recolors all black / grey to new_color- remove_white- remove_blackColor Class- brighten(amount=10)- brighten!(amount=10)- darken(amount=10)- darken!(amount=10)- invert- invert!- greyscale(scaler=3)- greyscale!(scaler=3)- sepia? # Not sure whether it looks right or not - recolor(new_color) # sets to new color while maintaining current alpha- recolor!(new_color)- is_dark?- is_light?- is_color?- is_highshade?- is_midshade?- is_lowshade?- is_shade?- is_highred?(highval=180)- is_highgreen?(highval=180)- is_highblue?(highval=180)- is_highalpha?(highval=180)- is_lowred?(lowval=75)- is_lowgreen?(lowval=75)- is_lowblue?(lowval=75)- is_lowalpha?(lowval=75)- is_red?(val=0)- is_blue?(val=0)- is_green?(val=0)- is_alpha?(val=0)- is_visible?I am also wondering what other methods you guys have created for these two classes. Mostly methods for the bitmap class - to perform various filters and effects to the bitmaps. But whatever your methods do, if they are new and for these classes, please share ^_^
As always, your comments and thoughts are appreciated
To give you a little back story...
I recently began writing a script to rewrite the way that vx ace draws text. The script I have written essentially changes the regular fonts for an 'image reel' that can be customized alot more than what a font can be. At least that is the end game plan...
So while messing around with the aforementioned 'font image reel' script I began messing around with the Bitmap class. This was initially so that I could replace the white within the bitmap to another color - to enable alternate color fonts.
This is what I came up with...
As you can see, the result is less than desirable.
This is mostly due to the font image reel used having various shades of grey along with the black and white.
I posted a question within the RGSSx questions that dont deserve their own thread in the hope of finding a reasonable solution to this issue. The question was answered (somewhat) by 'Pablo Neirotti' who suggested I simply create a method like so..
class Color def dark? red <= 75 && green <= 75 && blue <= 75 endendand then check whether my current color (color of each pixel within the bitmap) is dark? before changing it to another color.
Unfortunately, this suggestion wielded the same results as above as this is essentially what I had done, in a different way..
next unless color.alpha > 0 next unless color.red < 80 next unless color.green < 80 next unless color.blue < 80But this suggestion got me thinking, why not just move what methods I can into the color class and then call them from the bitmap class when required. Thus creating more methods that can be used in both classes.
After a little bit of rearranging the code, I managed to create a combination of methods to determine whether my font color should be changed...
class Color #----------------------------------------------------------------------------- # #----------------------------------------------------------------------------- def is_light? is_visible? && is_highred? && is_highgreen? && is_highblue? end #----------------------------------------------------------------------------- # #----------------------------------------------------------------------------- def is_midshade? !is_dark? && !is_light? && is_shade? endendAs you can see, these methods utilize a fair number of other new methods. The result though, is undeniably a vast improvement.
Now, because I am directly modifying the bitmap, rather than changing the color / tint of an actual sprite, this means I can modify more than just my font images...
I could, for example, invert EVERYTHING...
So while messing around with the aforementioned 'font image reel' script I began messing around with the Bitmap class. This was initially so that I could replace the white within the bitmap to another color - to enable alternate color fonts.
This is what I came up with...
As you can see, the result is less than desirable.
This is mostly due to the font image reel used having various shades of grey along with the black and white.
I posted a question within the RGSSx questions that dont deserve their own thread in the hope of finding a reasonable solution to this issue. The question was answered (somewhat) by 'Pablo Neirotti' who suggested I simply create a method like so..
class Color def dark? red <= 75 && green <= 75 && blue <= 75 endendand then check whether my current color (color of each pixel within the bitmap) is dark? before changing it to another color.
Unfortunately, this suggestion wielded the same results as above as this is essentially what I had done, in a different way..
next unless color.alpha > 0 next unless color.red < 80 next unless color.green < 80 next unless color.blue < 80But this suggestion got me thinking, why not just move what methods I can into the color class and then call them from the bitmap class when required. Thus creating more methods that can be used in both classes.
After a little bit of rearranging the code, I managed to create a combination of methods to determine whether my font color should be changed...
class Color #----------------------------------------------------------------------------- # #----------------------------------------------------------------------------- def is_light? is_visible? && is_highred? && is_highgreen? && is_highblue? end #----------------------------------------------------------------------------- # #----------------------------------------------------------------------------- def is_midshade? !is_dark? && !is_light? && is_shade? endendAs you can see, these methods utilize a fair number of other new methods. The result though, is undeniably a vast improvement.
Now, because I am directly modifying the bitmap, rather than changing the color / tint of an actual sprite, this means I can modify more than just my font images...
I could, for example, invert EVERYTHING...
Anyway...
Basically, I am wondering if other script writers would actually use a script that offers such features?
Current methods :
Bitmap Class- brighten(amount=10)- brighten!(amount=10)- darken(amount=10)- darken!(amount=10)- invert- invert!- greyscale(scaler=3)- greyscale!(scaler=3)- sepia? # Not sure whether it looks right or not - randomize(times=2)- randomize!(times=2)- make_color(new_color) # recolors all white / grey to new_color- make_shadow_color(new_color) # recolors all black / grey to new_color- remove_white- remove_blackColor Class- brighten(amount=10)- brighten!(amount=10)- darken(amount=10)- darken!(amount=10)- invert- invert!- greyscale(scaler=3)- greyscale!(scaler=3)- sepia? # Not sure whether it looks right or not - recolor(new_color) # sets to new color while maintaining current alpha- recolor!(new_color)- is_dark?- is_light?- is_color?- is_highshade?- is_midshade?- is_lowshade?- is_shade?- is_highred?(highval=180)- is_highgreen?(highval=180)- is_highblue?(highval=180)- is_highalpha?(highval=180)- is_lowred?(lowval=75)- is_lowgreen?(lowval=75)- is_lowblue?(lowval=75)- is_lowalpha?(lowval=75)- is_red?(val=0)- is_blue?(val=0)- is_green?(val=0)- is_alpha?(val=0)- is_visible?I am also wondering what other methods you guys have created for these two classes. Mostly methods for the bitmap class - to perform various filters and effects to the bitmaps. But whatever your methods do, if they are new and for these classes, please share ^_^
As always, your comments and thoughts are appreciated
Last edited by a moderator:
