Bug 157885 - help png images could use indexed colours
Summary: help png images could use indexed colours
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Win-Installer-Smaller Installer-Linux
  Show dependency treegraph
 
Reported: 2023-10-22 12:06 UTC by Jérôme
Modified: 2023-12-01 18:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
24 bits colours help/media/helpimg/sd_PresenterConsole02.png (116.83 KB, image/png)
2023-10-22 12:08 UTC, Jérôme
Details
24 bits colours indexed on 8 bits help/media/helpimg/sd_PresenterConsole02.png (33.00 KB, image/png)
2023-10-22 12:10 UTC, Jérôme
Details
colours indexed on 8 bits saves 325 kB in french localized help (11.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-11-18 15:28 UTC, Jérôme
Details
coulours indexed on 8 bits saves ~562kB in help from main MSI package (16.57 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-11-18 17:28 UTC, Jérôme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme 2023-10-22 12:06:44 UTC
The installed file directory ./help/media contains png images which use 24 bits colours.

The png images could use 256 indexed colours (chosen among 2^24 different colours).

This would make those files smaller but the user doesn't see the difference.
Comment 1 Jérôme 2023-10-22 12:08:55 UTC
Created attachment 190375 [details]
24 bits colours help/media/helpimg/sd_PresenterConsole02.png
Comment 2 Jérôme 2023-10-22 12:10:41 UTC
Created attachment 190376 [details]
24 bits colours indexed on 8 bits help/media/helpimg/sd_PresenterConsole02.png
Comment 3 Jérôme 2023-10-23 19:19:11 UTC
The images are in the following directories :
help/media/helpimg
help/media/screenshots

The png image are :
- in the main tree (main MSI archive on Windows)
- in each translation sub-directories (each translated help MSI archive on Windows).
Comment 4 Stéphane Guillou (stragu) 2023-11-07 17:01:08 UTC
That's a good point, anything that reduces the size of helppacks (and langpacks) is good to take in my opinion...

Cloph and Olivier, do you agree? If so, would this be automated somehow when packaging? Or a bulk conversion to be done on existing pictures, submitted as a patch?
Comment 5 Mike Kaganski 2023-11-17 19:36:56 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> That's a good point, anything that reduces the size of helppacks (and
> langpacks) is good to take in my opinion...

Not necessarily - if it slows down the processing. I don't know the exact effect of this change - and it *might* be beneficial generally, if IO dominates processing the images; but just as well, it could have negative effect, if conversion from indexed colors to 24 bit would be expensive.

I do not oppose this change - I suspect IO have more impact, so think it would be a good change; but I think that generalizing like "everything that reduces size if good" is incorrect.
Comment 6 Jérôme 2023-11-18 15:28:56 UTC
Created attachment 190901 [details]
colours indexed on 8 bits saves 325 kB in french localized help

Into the LibreOffice_7.6.2_Win_x86-64_helppack_fr.msi archive file.

I converted all png files with ImageMagick with this command :

find . -type f -iname '*.png' -exec convert "{}" -type Palette -define png:format=png8 -define png:compression-level=9 "{}8" \;

The attachment compares the orignal png files with the new indexed png on 8 bit with 24 bit colours.
Comment 7 Jérôme 2023-11-18 17:28:31 UTC
Created attachment 190902 [details]
coulours indexed on  8 bits saves ~562kB in help from main MSI package

From the LibreOffice_7.6.2_Win_x86-64.msi archive file, I converted all png files  in "help" folder with ImageMagik with this command :
find . -type f -iname '*.png' -exec convert "{}" -type Palette -define png:format=png8 -define png:compression-level=9 "{}8" \;

The attachment compares the orignal png files with the new indexed png on 8 bit with 24 bit colours.
Comment 8 Jérôme 2023-11-18 17:59:47 UTC
The palette uses a minimum size inside the png file. Maybe we could use indexed colours only for non indexed png files which are larger than a given size (400 bytes ?).