Re: [Wikitech-l] FLIF for Wikimedia

2017-12-11 Thread Ruben Kelevra
Hey Brian,

On 11.12.2017 00:10, Brian Wolff wrote:
> Maybe not a hard no, but I would rate the probability as somewhere around
> 1%.
> 
> If you really wanted to push this (with the understanding that its probably
> not going anywhere) I would say make a report, comingup with a solid case
> with a solid implementation plan, including:
> * what is the fallback plan for non js users and users with old browsers
> * what would the bandwidth saving be in typical usage on typical wikipedia
> pages
> * what is the server side latency on an uncached hit where we have to
> generate a thumbnail for the request, compared to existing formats
> *what is the client side latency to render with the polyfill compared to
> native format. What happens during rendering? What about people using
> old-generation cell phones with lackluster cpus? Is it in a separate worker
> thread or does it stop the main js thread? What is the general affect to
> the user during polyfil loading.
> *combining server side latency, client side latency bandwidth difference,
> etc what is the overall difference in loading time for the user on a
> typical wikipedia page- and what is it for a (client side) cached hit vs
> (server side i.e. thumb is already rendered) vs totally uncached where
> thumbnail has to be converted on the fly.
> 
> I think that would be the minimum information required to convince people
> to do this, and i doubt that that would be enough unless the numbers are
> super good.
Thanks alot for this open feedback, Brian. I think about that. :)


Best regards

Ruben

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] FLIF for Wikimedia

2017-12-10 Thread Ruben Kelevra
Hey Andre,

On 10.12.2017 22:10, Andre Klapper wrote:
> On Sun, 2017-12-10 at 21:42 +0100, Ruben Kelevra wrote:
>> So... to break the current discussion down, there is no hard "we
>> don't want this format" yet shown up.
>>
>> What's the next step guys?
>
> Working on widespread FLIF support among browsers/clients, to not
> require JavaScript support in browsers. In my humble opinion...
Well, I tried it again:

https://bugs.chromium.org/p/chromium/issues/detail?id=793683

Maybe this time they'll be a bit more open since WebP haven't been
getting off the ground for two years and FLIF still looks a lot more
promising in my eyes.


Best regards

Ruben

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] FLIF for Wikimedia

2017-12-10 Thread Ruben Kelevra
Sadly Google stick to cheer for their WebP-crap, my ticket #539120 for
the chromium project dated back to late 2015, while there are some
supporters, the main reason was back then 'it's not yet finalized' which
isn't true anymore.

Since we need the Poly-flif stuff anyway - not any user uses the latest
or the most advanced browser(s/ versions) - it's a good starting point,
isn't it?

I also create a feature request for all my daily driver software to get
FLIF support to this stuff too.


Best regards

Ruben

On 10.12.2017 22:10, Andre Klapper wrote:
> On Sun, 2017-12-10 at 21:42 +0100, Ruben Kelevra wrote:
>> So... to break the current discussion down, there is no hard "we
>> don't want this format" yet shown up.
>>
>> What's the next step guys?
> 
> Working on widespread FLIF support among browsers/clients, to not
> require JavaScript support in browsers. In my humble opinion...
> 
> andre
> 

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] FLIF for Wikimedia

2017-12-10 Thread Ruben Kelevra
So... to break the current discussion down, there is no hard "we
don't want this format" yet shown up.

What's the next step guys? Generate a feature request for MediaWiki
which enables FLIF as possible input-format and ships the poly-flif
JavaScript library for browsers which does not natively support FLIF?

We talk here about the chicken-egg problem, so yeah, this javascript
crap is hard to swallow, but we must start somewhere, right?

Best regards

Ruben

On 08.12.2017 22:00, Ruben Wisniewski wrote:
> Hey Thiemo,
> 
> On 06.12.2017 14:27, Thiemo Kreuz wrote:
>>> Point was more: Get rid of this bloody Download a JPG, do some Stuff &
>> Upload a 3 Times locally saved JPG again […]
>>
>> I'm afraid I did not made my point clear enough. With all respect to your
>> enthusiasm, but the scenario you describe is exactly what your suggestion
>> will not improve. How could it? We can not control what people do on their
>> local computers.I'm sure we can't, but we can follow our primary goal,
> to spread information and educate users to handle their contributed data
> and time better. JPG has huge generation loss, that's why I always
> choose PNG for my private files or use a program which can handle raw.
> 
> We don't educate the users currently about the right choice of file
> formats, so they upload their files in the format which is available for
> them.
> 
> Taking JPG directly from a camera which does not support raw is fine,
> but we should take the step and convert this initial JPG to a lossless
> format because:
> 
> Every user which edit those file will take the JPG and save a "new
> version" in the same format because they want to preserve the filename.
> 
> If we would convert the JPG to PNG or FLIF, this step would be lossless
> while we don't control anything on the user side.
> 
> This was my point.
>> Even worse: FLIF is not even needed for the scenario you describe. We
> could
>> just convert all JPEG to PNG. But this will not happen for the reasons
>> collected in this thread.
> 
> FLIF is better instead of PNG because it supports animations, is faster
> to decode, use less disk space. Also saving it interlaced does not
> increase the file size significantly and we just need to save one file
> instead of at least 3 different versions of the same file: the
> thumbnail, the zoomed version, and the original file.
> 
> With FLIF this file would be always the same while the browser would
> limit the amount of data required for the display size.
> 
>> Sure. Go and encourage people to upload RAW. That's very much welcome. But
>> converting their JPEG after they made them will make many scenarios worse.
> Well, yeah, I tried several times in the past ... and no, my RAW-Format
> is still not supported:
> 
> "Bei der Übertragung gab es einen Fehler
> Auf diesem Wiki sind Dateien mit der Endung „.NEF“ nicht zulässig."
> 
> Means .NEF is not supported.
> 
> "Bei der Übertragung gab es einen Fehler
> Auf diesem Wiki sind Dateien mit der Endung „.DNG“ nicht zulässig."
> 
> Means, .DNG is not supported.
> 
> With FLIF we could simply accept all which does have a free decoder and
> convert them to FLIF. Which would 'free' the file format. :)
> 
>> Even including the one you aim for: What you want is to allow people to
>> download an image, open, edit and save it without ever thinking about the
>> file format. FLIF can not do that, yet.
> Since we could easily convert the FLIF on export to PNG and any new
> version could be uploaded in PNG an internally converted to FLIF to
> reduce the disk space requirements as well.
> 
> I hope GIMP and Gnome will support FLIF soon.
> 
> 
> Thanks a lot for your critic, I appreciate our discussion. :)
> 
> 
> Best regards
> 
> 
> Ruben
> 
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> 

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] FLIF for Wikimedia

2017-12-04 Thread Ruben Kelevra
Hey Thiemo,

On 04.12.2017 10:43, Thiemo Kreuz wrote:> I consider myself an image
file format nerd, so thanks a lot for
> sharing this! FLIF was new to me.Don't mind it! :)

> I would like to share two important notes:
>
> 1. Unfortunately the flif.info website does not say a word about the
> CPU resources their current implementation burns when converting a,
> let's say, PNG to FLIF.Well, currently it's single core and not
optimized at all. You should know CABAC encoding from x264/x265 so it's
slow, but not dead slow.

The website doesn't mention it because it highly depends on the subject
as well as the setting on encoding named effort.

Currently, effort is default 60, I tried 100 a lot, but there's nearly
nothing to gain. So I assume we always want to use the good default. :)

PNG Encoding of the current featured picture of today[1] at a medium
image size for the web, 1.280×868 Pixel, opened in Gimp, converted to
sRGB and exported as maximum compression without any checkbox done in
Gimp ... takes Gimp 3 seconds to write it to the Harddisk.

Transcoding this PNG to FLIF takes on my machine (i3-2330M@2.20GHz; 12
GB RAM):
real 0m7,405s
user 0m7,320s
sys 0m0,053s

decoding the file again to PNG on the same machine (with FLIF)
real 0m1,077s
user 0m1,067s
sys 0m0,007s

For comparison, we save 708 KByte in comparison to PNG in this case, and
the PNG exported by FLIF is just 14 KByte bigger than the one created by
Gimp.

> It's pretty important to realize that CPU
> resources are even more valuable than storage space and network
> bandwidth. Sure, It's not really possible to come up with an exact
> threshold. But if, let's say, converting a PNG to FLIF saves 100 KiB,
> but takes a minute, this minute will never pay off.
So my Point was more: Get rid of this bloody Download a JPG, do some
Stuff & Upload a 3 Times locally saved JPG again, calling it an improvement.

> If you follow the discussions on Wikimedia Commons, you will find this
> argument quite often: Downloading PNGs, optimizing them, and uploading
> them again is practically never worth it. Think of all the resources
> that are burned to do this: CPU time, download and upload, database
> storage and time, disk storage for the new revision, and not to forget
> the user doing all this.
Yep, but enabling FLIF for new files would do nothing to the old Data at
all, I don't want to start a discussion about converting petabytes of
Data, but all new revisions should be done in FLIF, if you ask me.
> Sure, your suggestion avoids a lot of this. But the CPUs involved will
> experience heavy load, both on the server as well as clients that need
> to recode FLIF files via a JavaScript library first.
FLIF is very fast to decode via JavaScript, and in general, as the
example shown above, it takes just 1 second to decode and encode a
medium size image as PNG with just one thread on a pretty outdated
notebook with an unoptimized decoder and encoder. :)

Try adding a FLIF to a website and test out if the website load anywhat
slower with the FLIF ... at the small image sizes you get on articles,
the performance impact is neglectable and comparable to loading a font
file to the browser.
> 2. Lossy file formats like JPEG should never be converted to lossless
> formats. This will actually decrease quality (over time). The problem
> is that the image data will still contain the exact same JPEG
> artifacts, but the fact that it was a JPEG (and how it was encoded) is
> lost.
Yes, but those images should never be saved as JPG in the first place.
Even under Android RAW-Photography is going to be a thing. FLIF just
started to get rudimentary RAW-capabilities, which means you can just
convert the special RAW-File to a FLIF and upload it with any loss in
quality.

> No tool specialized in squeezing the maximum quality out of
> lossy JPEGs can work anymore. And there are a lot of super-awesome
> tools like this. Not only tools like JPEGCROP and such that can cut
> and even combine JPEGs without actually recoding them.
Well, if you really want to start a discussion about a lossless rotation
of JPG files, let me guess how many uploads are rotated losslessly...
0.0002%?

> There are also "JPEG repair" filters that know how to reverse the JPEG
encoding
> algorithm and can squeeze out a tiny little bit of extra information
> regular JPEG decoders can't see.
Great! Just recommend this for new uploads to be done if the source
material is JPG, let the ppl convert it with this to PNG and then to
FLIF or ask the FLIF maintainers if they want to add this as an
import-filter, for FLIF itself! :)

But the your argument was: "Think of all the resources that are burned
to do this: CPU time, download and upload, database storage and time,
disk storage for the new revision, and not to forget the user doing all
this."

Which perfectly fit's here too. On a 20 MPixel picture small JPG
Artefacts are no issue at all, but users which Download the JPG and
upload it again, after doing some needed work to 

Re: [Wikitech-l] FLIF for Wikimedia (Demonstration)

2017-12-03 Thread Ruben Kelevra
I've picked a featured image of today for a small demonstration:

$ du -h Mansudae-Monument-Bow-2014.* | sort -n
2,0MMansudae-Monument-Bow-2014.jpg
4,9MMansudae-Monument-Bow-2014..progressiv.jpg *
6,5MMansudae-Monument-Bow-2014.flif
16M Mansudae-Monument-Bow-2014.png

*(saved again with Gimp as progressive JPG with Quality 100%)

I cut it to 50 KiB (the desired size for a thumbnail of around 100px).

$ dd if=$if of=$of bs=1024 count=50

$ du -h Mansudae-Monument-Bow-2014.50KiB.* | sort -n
52K Mansudae-Monument-Bow-2014.50KiB.flif
52K Mansudae-Monument-Bow-2014.50KiB.jpg
52K Mansudae-Monument-Bow-2014.50KiB.png

The original image[1] in contrast to the 50 KiB FLIF[2] which
outperforms progressive JPG[3] as well as interlaced PNG[4].

https://imgur.com/a/84RbJ

And I did another test with 250 KB to simulate a further download of the
file:

https://imgur.com/a/twXxr

Those tests show clearly an advantage of FLIF at this time since only
JPG progressive has any chance of competing fair... which means we still
have to rely on generation loss and lossy compression.

FLIF, on the other hand, does not have any (heavy) generation loss, as
WebP, JPG or JPG2000 do have on lossy compression.

FLIF is also able to provide a 3.77% Download a 200px width thumbnail
with very low distortion and with just 0.75% a 100 px width thumbnail
with very low distortion. While the main competitor (PNG) still shows a
black screen.

FLIF in comparison also provides the ability to store motion-pictures
like GIF or APNG which is still not widely supported for PNG.


---


Hope this helps a bit without extensive own testing to get an impression
of the capabilities of this file format.



Best regards

Ruben

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] FLIF for Wikimedia

2017-12-03 Thread Ruben Kelevra
Hey Andre,

On 03.12.2017 00:49, Andre Klapper wrote:
> On Sat, 2017-12-02 at 22:20 +0100, RubenKelevra wrote:
>> There's a small JavaScript library which can be used until there's a
>> browser support given, so theres no need to wait until there is
>> browser-support.
>
> Please provide a link to that library.

the library called Poly-FLIF and you can find a livedemo[1] and the
sourcecode on github[2].

[1] https://uprootlabs.github.io/poly-flif/
[2] https://github.com/UprootLabs/poly-flif


Best regards


Ruben


> 

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l