godot icon indicating copy to clipboard operation
godot copied to clipboard

QOI Image Support

Open basicer opened this issue 10 months ago • 6 comments

  • Production edit: This closes https://github.com/godotengine/godot-proposals/issues/3726.

basicer avatar Apr 28 '24 00:04 basicer

Missing acknowledgement in COPYRIGHT.txt

Files: ./thirdparty/qoi/
Comment: Quite OK Image Format
Copyright: 2024, Dominic Szablewski
License: Expat

DeeJayLSP avatar Apr 28 '24 01:04 DeeJayLSP

Thanks for the comments! I opened this as a draft as I knew I had a few more passes to go though before it was ready for review.

My biggest question is what should be done about MovieWriterPNGWAV? What I did makes a lot of sense, but then the name of the classes is a bit odd? Options as I see it are:

  1. Don't change anything.
  2. Rename this class to MovieWriterImgWAV
  3. Make a new class MovieWriterQOIWAV, with mostly duplicate code.

basicer avatar Apr 29 '24 00:04 basicer

  1. Rename this class to MovieWriterImgWAV

Renaming classes is considered compatibility break, and should only be done between major versions.

  1. Make a new class MovieWriterQOIWAV, with mostly duplicate code.

I see some parallels with my QOA implementation. The original version was a module to import and play QOA files, but since QOA isn't a popular format to be converted to (unlike QOI, although not widely adopted as something like JPEG XL) I added a converter from WAV, with a lot of duplicated code.

But because I was never satisfied with that implementation, I ended up rewriting it inside the WAV code, as a compression mode rather than a separate format. No class renames and most importantly: no duplicated code.

IMHO, the best alternative would be 1. Making a new class and duplicating code has a considerable impact on binary size.

DeeJayLSP avatar Apr 29 '24 06:04 DeeJayLSP

I suggest keeping the class name as-is, while adding a note in the class reference about why the class is named PNGWAV even if it supports QOI.

For instance, you can add this at the bottom of doc/classes/MovieWriterPNGWAV.xml's <description> tag:

[b]Note:[/b] For historical reasons, this class is named MovieWriterPNGWAV even though it also supports writing the QOI image format.

Calinou avatar Apr 29 '24 21:04 Calinou

  1. Rename this class to MovieWriterImgWAV

Renaming classes is considered compatibility break, and should only be done between major versions.

  1. Make a new class MovieWriterQOIWAV, with mostly duplicate code.

I see some parallels with my QOA implementation. The original version was a module to import and play QOA files, but since QOA isn't a popular format to be converted to (unlike QOI, although not widely adopted as something like JPEG XL) I added a converter from WAV, with a lot of duplicated code.

But because I was never satisfied with that implementation, I ended up rewriting it inside the WAV code, as a compression mode rather than a separate format. No class renames and most importantly: no duplicated code.

IMHO, the best alternative would be 1. Making a new class and duplicating code has a considerable impact on binary size.

I noticed in the QOA patch, you added the header file to misc instead of making a separate folder. I suppose I should do that here too.

basicer avatar May 03 '24 04:05 basicer

MovieWriterPNGWAV

Seems like that class isnt documented because its not reflected directly.

basicer avatar May 05 '24 06:05 basicer