plugin.program.AEL.dev icon indicating copy to clipboard operation
plugin.program.AEL.dev copied to clipboard

[Feature request] Customisable assets dimensions

Open Hybrid512 opened this issue 3 years ago • 4 comments

Hi,

I discovered that, when assets are scrapped, they are stored in their original dimensions and file format. To be honest, this is a waste of space and a real pain regarding performances especially when there are hundreds of assets or when they are stored on a network disk (like in my case).

Some assets are quite small and fast but some are huge with more that 4Mb with a resolution over 2000px wide and some are even in PNG which is not the bast format you can find regarding space efficiency.

To give you an example, for one of my romset with about 600 rom files (not even the biggest), my assets directory for this platform already accounts for more than 1.5Gb which is more than the total space used by the ROM files themselves ;p

Assets size really depends on screen resolution and with a 1080p screen size, 500px for boxfronts and maybe 2000px for fanarts in JPEG format wityh decent compression (like 80~90) is way enough. Of course, you might need more with a >4k display.

I think it would be great to have the possibility to set custom MAX horizontal size for each assets types in the preferences so that the user can define what he wants as max picture dimensions, limiting that way the size (and thus, load time !) it takes when scrolling huge romset list.

For example something like this, no value would be equal to "no limit" which is the current behavior :

  • 3dboxes : 200px
  • banners : 400px
  • boxback : 500px
  • boxfront : 500px
  • ...
  • fanarts : 2000px
  • ...

The workflow would then be something like that :

  • scrap an asset (boxfront) from the scraper website
  • if custom size for boxfront is set AND picture width is over that size, schrink the picture to the max width size, else, don't resize anything
  • convert the picture (resized or not and whatever the original format) to JPEG/85% compression level and remove every metadata such as exif/iptc

People with huge screen resolutions like >4k could then limit the assets to bigger or unlimited size but people with lower specs or I/Os limited hardware with smaller resolutions like 1080p would greatly benefit from this change. This will probably make scraping process a little longer (not even sure of that with decent hardware) but will make general usage a lot smoother when navigating in the rom lists.

Best regards.

Hybrid512 avatar Jun 17 '21 21:06 Hybrid512

I know what you mean... For most systems the artwork takes more space that the compressed ROMs. An this is only taking into account images... if you like video previews then the space occupied by the assets gets crazy.

The feature you propose could be OK for a future version, or maybe an utility in the Utilities menu.

Wintermute0110 avatar Jun 18 '21 07:06 Wintermute0110

I know what you mean... For most systems the artwork takes more space that the compressed ROMs. An this is only taking into account images... if you like video previews then the space occupied by the assets gets crazy.

The feature you propose could be OK for a future version, or maybe an utility in the Utilities menu.

Ok for a future version because it needs to do UI modifications taking care of new settings, ... I know it can be a lot of work but can't you just implement the conversion process ? Don't resize but at least compress/convert files to JPEG/80%, that would already help a lot.

Hybrid512 avatar Jun 18 '21 08:06 Hybrid512

I can do it but it will require the PIL library and it will take time. I prefer to release soon because in the following months I won't have much free time.

In the mean time, you can use external tools for this. For example, in Linux it's very easy to use the command line tool ImageMagick and some shell script to convert all your files. In Windows you can use Cygwin which provides you with a Linux-like environment.

Wintermute0110 avatar Jun 18 '21 10:06 Wintermute0110

That's what I did. For my personal case, I have a rom set of about 700+ roms (SNES), before resizing/compressing assets, my assets folder was >1.7Gb. I resized boxfronts/boxback to 500px wide and fanarts to 2000px wide (I'm running Kodi on a 1080p screen resolution). I also converted all those files to jpg (there were some png and I had to fix the assets names in the rom database).

Now, my assets folder is less than 200Mb. Loading times are way faster and the ROM list UI is also a lot more responsive now.

I understand this can be delayed since this is not high priority and there are alternative ways to get the same results (like what I did) but please, keep that under your hand because this really gives a nice performance boost and this is way more enjoyable for end users.

Best regards.

Hybrid512 avatar Jun 21 '21 07:06 Hybrid512