PDA

View Full Version : Asset image size questions



Morenu
November 15th, 2024, 02:27
1) Is there a recommended size for Asset Images and Tokens? I am currently maxing at 200kb each with 150kb or less preferred. but I am wondering if that is overkill.

2) Is there a file type that works best for size vs quality vs easier for FGU to process? currently my images are Jpg and my tokens are png (token creator's default).

3) I know if I convert the File type of an image (say png to jpg) but the name is otherwise the same, I must relink it as it is a completely new image essentially. BUT if I change or reduce the file size but the name and filetype stay the same, does it change everything it is linked to? I could test this one myself I believe.

Essentially I am trying to see what my best file size to image quality should be on Tokens and images for a 4000+ bestiary so I don't make it too bloated but also have quality images.

Thx.

Moon Wizard
November 15th, 2024, 02:31
All files are converted into textures in memory for display, which is why we have recommended asset file sizes by asset type.
https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/2037547009/Developer+Guide+-+Product+Guidelines

File sizes will affect network transport times and load times; which file dimensions will affect memory usage and display speeds. We’ve found that WebP at 75% quality tends to have the best tradeoff for quality vs size.

Regards,
JPG

Morenu
November 15th, 2024, 03:04
All files are converted into textures in memory for display, which is why we have recommended asset file sizes by asset type.
https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/2037547009/Developer+Guide+-+Product+Guidelines

File sizes will affect network transport times and load times; which file dimensions will affect memory usage and display speeds. We’ve found that WebP at 75% quality tends to have the best tradeoff for quality vs size.

Regards,
JPG

Thanks. I will play with that and pause what I am doing. maybe I can add the tokens camera if I am going through all this anyway.... I don't use the 2.5D so very unfamiliar with it... ok playing around time...

Morenu
November 15th, 2024, 04:00
Thank god for macros... 150 jpgs to Webp in 1 hour... now for the tokens... then onto seeing about the 2.5d and relinking 150+ NPCs to the new assets. curious to see how much the mod shrinks in size :)

and BTW, the quality took almost no hit but the size was cut in half or more. the new max is 50kb

edit...
And I went from 17.1MB of tokens to 1.8MB... nice

Moon Wizard
November 15th, 2024, 05:50
Yeah, the .webp compression is significantly better. That's what we found as well.

Regards,
JPG

Morenu
November 15th, 2024, 07:21
AND.... Now you've got me doing all 3 images for around 4000 PFrpg NPCs.... sigh... silly 2.5D Transparent images in Webp format. flat token and a sharable full image. why do I do this to myself. LOL

And so it begins...

62607

https://youtu.be/kTi6WPtXmQ4

damned
November 15th, 2024, 08:03
Lots of tools to help you do that in bulk.

Morenu
November 15th, 2024, 08:25
which one? I just got done fixing the 150 or so NPCs I did already (dropped my mod from 51MB to 30MB) and from this point on I will create the transparent image along with the other 2 and convert them to webp. getting the image I want and having it auto remove the background are the 2 variables. the rest is reasonably quick. and if the transparent background goes well, its fast too. But I think it will be great if anyone doing PFrpg wants to try the 2.5D, all the critters will be ready.

Zacchaeus
November 15th, 2024, 09:19
which one?

This is the one I use https://www.ffmpeg.org/

LordEntrails
November 15th, 2024, 16:07
I use GIMP with the BIMP add on. It makes batch image manipulation, such as sizing or format conversions very quick and easy for me.

Also note, you can open up FG's xml files and do a find and replace to update the file extensions. I think you know all the caveats for that (while FG is shutdown, make backups).

Griogre
November 15th, 2024, 17:29
IrfanView is a free image manipulation program that has built in batch processing. It's super good for resizing and de-rezing.

Just to follow up on Moon Wizards comment on webp - webp are awesome when it comes to file compression - saving tons of space on your fixed drives/SSDs. However, the real image size issues in FGU revolve around the size of an image in *memory*. There is no image compression in FGU memory so an image that doesn't take up much file space can take up a lot more memory space. Just to give a small example the Black Dragon Token below is only 20K as a file but is 264K in memory.

This has little effect on things like tokens and portraits but it matters a lot with map images. It's easy to have a map image that is only a few megs that is 10 times larger in memory. Its the 10 times larger memory size that is actually transferred and updated.

pindercarl
November 16th, 2024, 13:34
IrfanView is a free image manipulation program that has built in batch processing. It's super good for resizing and de-rezing.

Just to follow up on Moon Wizards comment on webp - webp are awesome when it comes to file compression - saving tons of space on your fixed drives/SSDs. However, the real image size issues in FGU revolve around the size of an image in *memory*. There is no image compression in FGU memory so an image that doesn't take up much file space can take up a lot more memory space. Just to give a small example the Black Dragon Token below is only 20K as a file but is 264K in memory.

This has little effect on things like tokens and portraits but it matters a lot with map images. It's easy to have a map image that is only a few megs that is 10 times larger in memory. Its the 10 times larger memory size that is actually transferred and updated.

The size on disk effects the amount of network traffic as the files must be sent to each client. The smaller the file, the less network traffic.

When an image is displayed, Fantasy Grounds will open the image, push the image to the GPU, and then discard the image data from memory. Images take up memory on the GPU, not in main memory. Images greater then 100x100 pixels are compressed before being sent to the GPU. Images without an alpha channel (transparency) are compressed 8:1. Images with an alpha channel are compressed 4:1.

For example, a 256x256 pixel uncompressed image with an alpha channel is 256KB. With Webp compression at 75%, it might be around 24KB on disk. On the GPU the image will use 64KB. Without an alpha channel, it would be 32KB. A 2048x2048 image (like you might use for a map) is 16MB uncompressed, or 4MB with transparency and 2MB without transparency. The memory usage on the GPU will be of most concern to users with an integrated GPU, like an older Intel based Mac mini or many laptops, as these share the main memory. You may have a dedicated GPU with 8 GB of memory, but your players may have lower spec computers.

Griogre
November 16th, 2024, 15:48
@pindercarl, thank you for the information.