Proposal: Add thumbnails of different sizes to .kra files?

Boudewijn Rempt boud at valdyas.org
Mon Jun 20 13:30:08 UTC 2016


On Mon, 20 Jun 2016, Dmitry Kazakov wrote:

> It might be somehow related to the fact that Boud used to optimize Krita
> saving code. Probably, disabling the internal PNG compression made the
> speed much higher? Boud?

I don't think I experimented with that. The settings for saving the png
to kra and ora at least are not dependent on the last used png export
settings, but the compression is set to 0 there.

If someone wants to experiment, the code is here:

bool KisPNGConverter::saveDeviceToStore(const QString &filename, const QRect &imageRect, const qreal xRes, const qreal yRes, KisPaintDeviceSP dev, KoStore *store, KisMetaData::Store* metaData)

And it's this line: 

options.compression = 0;

That can be changed to 9

Boud

> 
> On Mon, Jun 6, 2016 at 9:11 PM, Alvin Wong <alvinhochun+krita at gmail.com>
> wrote:
> 
> > About the mergedimage.png, I see that the png itself isn't compressed
> > at all, only compressed by DEFLATE inside the zip container. For a
> > completely-transparent image of 3600x2400, the mergedimage.png is 33MB
> > uncompressed, which is ridiculous. It's 55KB compressed, much smaller,
> > but still a bit larger than expected.
> >
> > Would compressing the png itself and STORE it inside the zip container
> > instead be better? Might want to benchmark and compare.
> >
> > 2016-06-07 0:59 GMT+08:00 Boudewijn Rempt <boud at valdyas.org>:
> > > On Mon, 6 Jun 2016, Dmitry Kazakov wrote:
> > >
> > >> The only trouble I see with thumbnail generation is the speed. It would
> > be
> > >> great to see the speen benchmarks of saving a PNG of each size.
> > >
> > >
> > > Well that needs checking indeed.
> > >
> > >> People are complaining
> > >> about Krita saving too slow :( I even heard a wish (during the
> > KomMissia)
> > >> to disable any preview and mergedimage.png saving into .kra to make the
> > >> saving quicker.
> > >
> > >
> > > That's just flat-out not going to happen.
> > >
> > >
> > >>
> > >>
> > >>
> > >>
> > >> On Mon, Jun 6, 2016 at 3:44 PM, Boudewijn Rempt <boud at valdyas.org>
> > wrote:
> > >>       On Mon, 6 Jun 2016, Alvin Wong wrote:
> > >>
> > >>             Is that needed? I would imagine whatever plugins or programs
> > >> would
> > >>             already have known the absolute size they want in pixels,
> > >> independent
> > >>             of the dpi, and could just automatically take the closest
> > >> thumbnail or
> > >>             the mergedimage and scale it down accordingly.
> > >>
> > >>
> > >>       I don't know... Hidpi and Retina is still really confusing me
> > across
> > >> the board.
> > >>
> > >>             Perhaps you can also add a thumbnail of size 2048x2048 but I
> > >> wonder
> > >>             how much it would add to the file size...
> > >>
> > >>             By the way I remember seeing in the Krita git repo some
> > >> scripts which
> > >>             look like plugins for certain programs to extract the
> > >> thumbnail, but I
> > >>             can't seem to find them now. Does anyone know, other than
> > the
> > >> Windows
> > >>             shell extension, what other file managers or programs
> > >> currently
> > >>             supports extracting thumbnails from Krita files/
> > >>
> > >>
> > >>       Code for Qt applications is in the kimageformats repo now, I moved
> > >>       that some time ago. There are also scripts for nautilus and gnome.
> > >>
> > >>
> > >>             Best Regards,
> > >>
> > >>             Alvin
> > >>
> > >>
> > >>             2016-06-06 14:54 GMT+08:00 Boudewijn Rempt <
> > boud at valdyas.org>:
> > >>                   I think we can easily do this: but maybe we should at
> > >> the same time
> > >>                   add thumbnails with a @2 extension to prepare for
> > hidpi
> > >> and retina
> > >>                   displays?
> > >>
> > >>
> > >>                   On Mon, 6 Jun 2016, Alvin Wong wrote:
> > >>
> > >>                         Hi,
> > >>
> > >>                         I would like to suggest Krita add (uncropped)
> > >> thumbnail images of
> > >>                         different sizes to the file to allow faster
> > >> extraction of thumbnails
> > >>                         by external applications.
> > >>
> > >>                         There is currently one preview.png which is at
> > >> maximum 256x256, so
> > >>                         generating thumbnails larger than that would
> > >> require scaling down from
> > >>                         the mergedimage.png which could be very large
> > and
> > >> may take a
> > >>                         comparatively long time to process. Even though
> > >> the actual time per
> > >>                         file might not be much, it could add up for a
> > lot
> > >> of files.. Also, the
> > >>                         preview.png is cropped to the non-transparent
> > >> region
> > >>                         (https://bugs.kde.org/show_bug.cgi?id=363968)
> > >> which makes things a bit
> > >>                         weird and inconsistent.
> > >>
> > >>                         I think having thumbnails for the sizes
> > >> (maintaining aspect ratio) of
> > >>                         256x256 and 1024x1024 would suffice, but boud
> > >> suggested having 512x512
> > >>                         might be nice too. Adding in these sizes means
> > >> that, for thumbnails
> > >>                         equal to or below the available sizes, they can
> > be
> > >> extracted and
> > >>                         optionally scaled down from those instead of
> > >> scaling down from the
> > >>                         mergedimage.png. Obviously, sizes larger than
> > that
> > >> would still require
> > >>                         using the mergedimage.png, but hopefully it
> > would
> > >> be quite rare for an
> > >>                         application to request for thumbnails larger
> > than
> > >> 1024x1024... (4K
> > >>                         displays aren't popular yet... right?)
> > >>
> > >>                         For the record, according to this MSDN page
> > >>
> > >>
> > >> (
> > https://msdn.microsoft.com/en-us/library/windows/desktop/cc144118(v=vs.85).aspx
> > )
> > >>                         Windows asks for the sizes 32/96/256/1024.
> > >>
> > >>                         I am asking for this as the developer of the
> > >> Windows Shell Extension.
> > >>
> > >>                         Any suggestions?
> > >>
> > >>                         Best Regards,
> > >>
> > >>                         Alvin
> > >>                         _______________________________________________
> > >>                         Krita mailing list
> > >>                         kimageshop at kde.org
> > >>
> > https://mail.kde.org/mailman/listinfo/kimageshop
> > >>
> > >>
> > >>
> > >>                   --
> > >>                   Boudewijn Rempt | http://www.krita.org,
> > >> http://www.valdyas.org
> > >>                   _______________________________________________
> > >>                   Krita mailing list
> > >>                   kimageshop at kde.org
> > >>                   https://mail.kde.org/mailman/listinfo/kimageshop
> > >>
> > >>             _______________________________________________
> > >>             Krita mailing list
> > >>             kimageshop at kde.org
> > >>             https://mail.kde.org/mailman/listinfo/kimageshop
> > >>
> > >>
> > >>       --
> > >>       Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org
> > >>       _______________________________________________
> > >>       Krita mailing list
> > >>       kimageshop at kde.org
> > >>       https://mail.kde.org/mailman/listinfo/kimageshop
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Dmitry Kazakov
> > >>
> > >>
> > >
> > > --
> > > Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org
> > > _______________________________________________
> > > Krita mailing list
> > > kimageshop at kde.org
> > > https://mail.kde.org/mailman/listinfo/kimageshop
> > _______________________________________________
> > Krita mailing list
> > kimageshop at kde.org
> > https://mail.kde.org/mailman/listinfo/kimageshop
> >
> 
> 
> 
> 

-- 
Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org


More information about the kimageshop mailing list