moo-man / FVTT-DD-Import

Allows Importing Dungeondraft map files into FoundryVTT
MIT License
59 stars 27 forks source link

Big files wont get converted to webp #123

Closed Q-efx closed 1 year ago

Q-efx commented 1 year ago

You need different settings for webp conversion.

Not sure whats here used, you need on the command line: segments=1, low_memory, q=50 (to reduce the big size :) )

moo-man commented 1 year ago

If I recall from @m42e , the way webp conversion is implemented doesn't allow for these arguments

4cer commented 1 year ago

Assuming you have access to the original map project, here's a quick and dirty workaround.

In your map making software:

  1. First export into the universal battlemap format BUT use whatever option you can to obtain a solid color background image (eg. in Dungeon Draft turn down brightness to 0 in the export dialog). This should yield a far smaller file.
  2. Export as image (any type accepted by FVTT) with normal settings

In FVTT:

  1. Import the universal battlemap format (to obtain the wall layout etc)
  2. Replace the background of the new scene with your exported image
4cer commented 1 year ago

For those who cannot mess with the original project there is also hope.

Using a decent text editor:

  1. Open the universal battlemap file (since those files are huge, it may be a cumbersome task, so it may be preferred to use a programmatic method)
  2. Find the image member and copy its content aside
  3. Replace the contents with R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw== (BASE64-encoded 1x1 transparent pixel image)

NOTE: This line of the file should look like so: "image": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="

  1. Use a BASE64 decoding tool (such as https://www.rapidtables.com/web/tools/base64-to-image.html ) to obtain the background image a. Optionally save the image to a smaller format, such as .webp, using a decent image editor

In FVTT:

  1. Import the universal battlemap format (to obtain the wall layout etc)
  2. Replace the background image of the new scene with your decoded image
xeropresence commented 1 year ago

2.4.0 was generating webp's perfectly fine with my setup, now uploading the same dd2vtt generates a huge png with 2.5.1, conversion never seems to take place.

Single file upload using brave.