<div dir="ltr"><div>Yes, optional. The jpeg artifacts are a major reason I was looking into lossy pngs - even if they cause more distortion than jpeg, at least they look different, so people won't instantly recognise them. But the amount of compression I could achieve that way without bad degradation was only roughly equivalent to jpeg quality 99-100, so it's not worth it.</div><div>Another lossy compression method is to quantise 24-bit images to an image-specific 256-colour palette. This actually compresses really well, ~50% the size of a 24-bit png, and we already have all the code for it (in lib/gif.h). Average size over my test set is similar to jpeg quality 93-95. But this is bad for any image containing gradients or a lot of colours, far worse than jpeg. Still, often it looks good, so can be offered as an alternative. And I would autodetect if an image uses <=256 colours (not necessary in the master palette) and use that automatically without prompting. If it's a 256 colour image, it will probably compress exceptionally well anyway.<br></div><div><br></div><div>And obviously if you import a jpg we should simply store the jpg, there's no point decoding it*. Though you might want to reencoded it at a lower quality. But I intend to set a high minimum selectable quality, maybe around 85-88, to stop anyone from messing up their backdrops too much.</div><div><br></div><div>*The exception is if the game uses 8-bit instead of 24-bit colour depth. Then the conversion to master palette needs to be done on import. It's an option we should keep for stylistic reasons.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 30 Oct 2019 at 08:54, James Paige <<a href="mailto:Bob@hamsterrepublic.com">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Jpeg compression for backdrops sounds like a great feature. I know I would love it. Do you intend for it to be optional? (I know some people will hate the artifacts, even if minimal)<div dir="auto"><br></div><div dir="auto">I don't know why the mail's get delayed, but my first guess is dreamhost smtp weirdness<br><div dir="auto"><br></div><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 29, 2019, 6:55 AM Ralph Versteegen <<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>No fair, how come you recieved this svn commit email at least an hour ago, but I got it just now? It's pretty annoying that the emails are so delayed.</div><div><br></div><div>Anyway, the reason that I added a jpeg encoder is that I've been investigating how to store graphics in compressed format inside .rgfx lumps (err... post Fufluns). Embedding .png and .jpg files inside .rgfx is certainly not to my liking. I've been doing a LOT of experiments with 24bit backdrops and reached the unavoidable conclusion that JPEG at quality 90-95 blows everything else out of the water for lossy compression of backdrops, unless you want to want to use something better like FLIF or BPG or HEIC/HEIF or WEBP which would require a huge (and slow!) library to decode/encode. And JPEG file format is actually pretty simple, unlike e.g. PNG. So there's no reasonable alternative to embedding JPEGs inside .rgfx for that use case.</div><div>However, JPEG doesn't support an alpha channel, so that's one problem (it'll need to be stored separately). And it's not suitable for tilesets or sprites (it's uncompetitive for compression of repetitive images anyway).</div><div><br></div><div>On the other hand it looks like there's no reason to embed PNG;  it's not hard to beat it with something much simpler because it's a complex file format around a pretty simplistic compression method.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 29 Oct 2019 at 22:44, James Paige <<a href="mailto:Bob@hamsterrepublic.com" rel="noreferrer" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Neat! :)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 29, 2019, 5:24 AM  <<a href="mailto:subversion@hamsterrepublic.com" rel="noreferrer" target="_blank">subversion@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">teeemcee<br>
2019-10-29 02:24:41 -0700 (Tue, 29 Oct 2019)<br>
69<br>
Allow jpg/jpeg as a screenshot format (gfx.screenshot_format setting)<br>
---<br>
U   wip/allmodex.bas<br>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" rel="noreferrer" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>