← Back to team overview

ubuntu-appstore-developers team mailing list archive

Re: Minimizing icon and screenshot transfer size

 

On Tue, 2014-04-22 at 12:03 -0300, Alejandro J. Cura wrote:
> On Tue, Apr 22, 2014 at 11:05 AM, Michał Sawicz
> <michal.sawicz@xxxxxxxxxxxxx> wrote:
> > On 22.04.2014 15:54, Rodney Dawes wrote:
> >> What about automatically running pngcrush on all uploaded PNGs? In some
> >> cases, this might reduce the image size quite a bit. Do we support SVG
> >> as a format for the icon on the server? An SVG compressed with gzip -9,
> >> with the file extension of .svgz should be loadable by Qt already, and
> >> should be a very significant reduction in file size of the image.
> >> Supporting and encouraging the SVG path is probably something we should
> >> do anyway.
> >
> > Even when you do SVG, you often want to reduce detail on lower
> > resolution screens, so even with vectors we need to support multiple
> > (even if less variations) sizes.
> >
> > What's more, we should check, but my feeling is that rendering an SVG is
> > more costly than loading a PNG. Not something we should disregard -
> > maybe the cache could cache the rendered bitmap. Unfortunately then Qt
> > doesn't render all SVGs correctly, two examples being the web browser
> > and gallery icons, which you can actually see in the image currently.
> > Work on this would be needed if we wanted Qt to render them.
> 
> There's some recent GPU acceleration of SVG rendering in Chrome, but I
> think we are far from using such a thing for our icons, so indeed
> rendering SVG will be more cpu costly than the simple deflate
> algorithm that PNG uses.

I'm not sure what renderer is being used by Qt, but I do know that for
most icons, librsvg is as fast as libpng, for rendering. So I don't
think this is as big of an issue any more, as most people seem to think
it is. Even for fairly complex icons, rendering of SVG is almost as fast
as PNG in modern optimized renderers.

> But there's a bigger issue when rendering SVG, and that is the varying
> support of SVG extensions like filters effects in different renderers
> (eg the qt renderer and the browser renderer). A designer using, say,
> Illustrator would be surprised when the icon rendered on a device does
> not look "just right".

This is a problem with icons drawn with Inkscape as well. But at the
same time, developers should be testing their apps and images inside Qt
before packaging them and shoving them off to the store. The point of
upload should not be when these issues are found. Even with PNG, such
weird things can happen, if any data is corrupted during upload, or even
during download. Networks can be very annoying things. :)

My suggestion wasn't to replace all the PNGs with SVGs. In some cases
that's just not feasible, because the images were drawn with raster
editors anyway. But making SVG an option on upload, will let people who
want to use it, use it, and can certainly help reduce file size for
transferring the icon. I'd certainly want to be able to use it for any
apps I were to make.




Follow ups

References