image, alone, can not accept image properties
and...
Position() does not accept "anchor" and "pos" tuples. (Not sure about others that are used.)
and
AlphaMask() demands an "alpha" channel for any alpha function to work. One would assume that a simple greyscale image could be used as the alphamask image, and it can not. Not much of a hindrance to push the greyscale to the alpha and paint the image black, to save file-size... But a greyscale PNG, for some reason, can't have an alpha-mask in my paint program. Even though the alpha-mask is just a greyscale image. (That's an oddity, but not a RenPy oddity.
)
Some people might not know how to make an alpha-mask, or might make one, but also retain the 24-bit/32k image (or larger) in addition to the mask, leading to 2x bloated image sizes.
I would like to try using a JPG greyscaled, as an alpha-mask, but RenPy doesn't read JPG with an alpha-mask and my program doesn't save alpha-masks to JPG anyways, but other programs can. I can crush that to 1/100th of a PNG, data-wise. (I already reduced my overhead by 90% using JPG for the image and just a PNG alpha for the alpha, compared to using just a simple PNG alone. But 99% reduction would be better. lol.)
My worst offending PNG was about 3,649KB, with the alpha-mask.
As a JPG with 80% quality, (20% reduction), and a separate PNG alpha-mask, it was only 65KB and 66KB = 131KB (3.6% of the original file-size, 96.4% reduction.)
Finally settled with something closer to 85% quality (15% reduction), which bumped it back up to about 90% total reduction. (Purely psychological.)
Eg, I turned my 10GB game into about a 1GB download, after all was said and done.
Samples:
Code: Select all
label start:
image test1 = "test1.png"
#Would expect/like something like this to work...
#(Minus the "at", which would look like an "image attribute". Even though they are actually attributes, just not what RenPy calls an attribute.)
#image test1 = "test1.png" Position(anchor=(0.5,0.5), pos=(0.5,0.5))
image test2 = AlphaMask("test2.jpg", "test2.png", anchor=(0.5,0.5), pos=(0.5,0.5))
image test3 = Image("test3.png", anchor=(0.5,0.5), pos=(0.5,0.5))
window hide
#Needs xanchor, yanchor, xpos, ypos.
show test1 at Position(xanchor=0.5, yanchor=0.5, xpos=0.5, ypos=0.5)
pause
hide test1
show test2
pause
hide test2
show test3
pause
#Would also expect these to work, since test2 and test3 is essentially "these"... but it doesn't
#show AlphaMask("test2.jpg", "test2.png", anchor=(0.5,0.5), pos=(0.5,0.5))
#... (more similar functions on the page below) ...
#show Image("test3.png", anchor=(0.5,0.5), pos=(0.5,0.5))
return
Also... somehow, please link these two pages together... (It is difficult to find the two alone, and both are sort-of hand-in-hand requirements for "images" to be displayed.)
https://www.renpy.org/doc/html/displaying_images.html
https://www.renpy.org/doc/html/displayables.html
Also... lol...
The "list of images from the '\images\' folder"... Is there a way to access that list of images, which RenPy has pre-setup as 'image _____'. (The new feature that pre-defines all images in that folder. I found the option to disable it, but I don't want to disable it.)
Also...
Can you let us tell RenPy which OTHER folders, and/or sub-folders to include for similar pre-defined images. (Not sure if I saw a setting for that, or if it already does that, or just peeks around when asked, for similar image-names.)
Wish-list item here too...
Assume images "xxx.jpg" and "xxx.png" are a potential mated pair, for use in AlphaMask(). (Thus, if only one name is given, without an extension used, and both types exist, each goes to the assumed location.)
Bonus if that extended to "show xxx", if xxx is not specifically defined. So AlphaMask() doesn't have to be typed at all. Since there would be no other reason to have one filename with two extensions in the images folder, with RenPy's auto-define working. (Since auto-define normally would have selected PNG over JPG anyways, when two exist. Thus, if auto-define is turned-off, it would NOT assume that, obviously.)
How it is now... AlphaMask() or Image()... same same...
Code: Select all
image test1 = AlphaMask("test1.jpg", "test1.png", pos=(0.5,0.5), anchor=(0.5,0.5))
You could actually get rid of Image() and AlphaMask(), if you just did this...
Code: Select all
image test1 = "test1.jpg", mask="test1.png", pos=(0.5,0.5), anchor=(0.5,0.5)
"mask" being an optional attribute, including the other attributes, obviously... comma's shouldn't be needed, but accept them if they exist... That still gratifies the input expected.
Code: Select all
image test1 = "test1.jpg" mask="test1.png" pos=(0.5 0.5) anchor=(0.5 0.5)
If you assume a second name, without an "=" is the mask... (Because it would not be anything-else.)
Code: Select all
image test1 = "test1.jpg" "test1.png" pos=(0.5 0.5) anchor=(0.5 0.5)
Now you just reduced three/four things into one. (Less to type, document and one location in the help-file says it all.)
Now, if you "assumed" the matching pair was the mask... (Super simplified and it still works without a mask-image too. Obviously.)
Code: Select all
image test1 pos=(0.5 0.5) anchor=(0.5 0.5)
test1 being the solid image test1.jpg and test1.png being the assumed mask, if it exists. With the rest being normal attributes. (That now makes this a predefined image-set. If not defined, "show test1" would show the same image masked, just at the default Position() when shown, unless "at Position()" was used, obviously, or just "show test1 pos=(0.5 0.5)" etc...)