GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Lossless Optimization of PNG files · Issue #74845 · python/cpython

Lossless Optimization of PNG files #74845

New issue
Copy link
New issue
Copy link
Closed
Closed
Lossless Optimization of PNG files#74845
Copy link
Labels
3.8 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirperformancePerformance or resource usagePerformance or resource usage

Description

tiagofilipesilva
mannequin
opened on Jun 13, 2017
Issue body actions
BPO 30660
Nosy @vstinner, @methane, @serhiy-storchaka, @tiagofilipesilva
PRs
  • bpo-30660: Replaced PNG files with their lossless optimized version #2141
  • bpo-30660: Doc: Optimize PNG files #8032
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-07-01.07:03:26.091>
    created_at = <Date 2017-06-13.23:11:28.720>
    labels = ['docs', '3.8', 'performance']
    title = 'Lossless Optimization of PNG files'
    updated_at = <Date 2018-07-01.07:03:26.088>
    user = 'https://github.com/tiagofilipesilva'

    bugs.python.org fields:

    activity = <Date 2018-07-01.07:03:26.088>
    actor = 'methane'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-07-01.07:03:26.091>
    closer = 'methane'
    components = ['Documentation']
    creation = <Date 2017-06-13.23:11:28.720>
    creator = 'tfs'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30660
    keywords = ['patch']
    message_count = 7.0
    messages = ['295969', '295989', '295990', '298375', '320795', '320801', '320826']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'methane', 'docs@python', 'serhiy.storchaka', 'tfs']
    pr_nums = ['2141', '8032']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue30660'
    versions = ['Python 3.8']

    Activity

    1. tiagofilipesilva commented on Jun 13, 2017

      @tiagofilipesilva
      tiagofilipesilvamannequin
      on Jun 13, 2017
      MannequinAuthor
      More actions

      I took the liberty to apply tools that optimize the binary weight (without loss of quality) of the 14 PNG files present in the Python 3.7 source tree and then applied a pull request (bpo-2141).

      Is there anything to be discussed? Thanks.

    2. tiagofilipesilva
      added
      3.7 (EOL)end of lifeend of life
      performancePerformance or resource usagePerformance or resource usage
      on Jun 13, 2017
    3. serhiy-storchaka commented on Jun 14, 2017

      @serhiy-storchaka
      serhiy-storchaka
      on Jun 14, 2017
      Member
      More actions

      What tools did you use, optipng, advpng, pngcrush, pngnq, pngquant, or other? How much space is saved?

      Note that some tools remove an information about palette that makes files displaying differently on different platforms and output devises.

    4. vstinner commented on Jun 14, 2017

      @vstinner
      vstinner
      on Jun 14, 2017
      Member
      More actions

      I suggest to work on Sphinx to propose to implement this optimization on the HTML rendering, maybe with optional external tools. What do you think?

      Another attempt: bpo-27461 :-)

    5. tiagofilipesilva commented on Jul 14, 2017

      @tiagofilipesilva
      tiagofilipesilvamannequin
      on Jul 14, 2017
      MannequinAuthor
      More actions

      Sorry for the late reply. I had to deal with stuff.

      serhiy.storchaka:

      What tools did you use, optipng, advpng, pngcrush, pngnq, pngquant, or other? How much space is saved?

      I had half a crate of whiskey that day so I'm going to say optipng and pngcrush were used and if my recollection is good the saved space was ≈ 5 to 50 % depending on the file.

      Note that some tools remove an information about palette that makes files displaying differently on different platforms and output devises.

      I am aware of that. But if I understood correctly these files are rendered in documentation, and I don't think they're going to do this in a PlayStation 2. There may be complaints with Windows XP users because I remember for sure that optimized PNG files could not render very well back in those days.

      haypo:

      I suggest to work on Sphinx to propose to implement this optimization on the HTML rendering, maybe with optional external tools. What do you think?

      Like you I'm very fond of a long-term proper solution and that is, by the way, the solution you deserve.

      Unfortunately, I do not have the skills for provide that. I can only give the solution you need (which is smaller files).

    6. methane commented on Jun 30, 2018

      @methane
      methane
      on Jun 30, 2018
      Member
      More actions

      It seems PR author removed his repository and the PR can't be merge via conflict.

      In master branch:

      02:18 $ ll **/.png
      -rw-r--r-- 1 inada-n staff 3732 7 1 02:13 faq/python-video-icon.png
      -rwxr-xr-x 1 inada-n staff 49648 7 1 02:09 howto/logging_flow.png

      -rw-r--r-- 1 inada-n staff 24719 7 1 02:09 library/depgraph-output.png
      -rw-r--r-- 1 inada-n staff 11148 7 1 02:09 library/hashlib-blake2-tree.png
      -rw-r--r-- 1 inada-n staff 11280 7 1 02:09 library/pathlib-inheritance.png
      -rw-r--r-- 1 inada-n staff 45021 7 1 02:09 library/tulip_coro.png
      -rw-r--r-- 1 inada-n staff 39585 7 1 02:09 library/turtle-star.png
      -rw-r--r-- 1 inada-n staff 48994 7 1 02:13 using/win_installer.png

      In lossless_png branch:

      $ ll **/*.png
      -rw-r--r--  1 inada-n  staff   2791  7  1 02:28 faq/python-video-icon.png
      -rwxr-xr-x  1 inada-n  staff  19351  7  1 02:28 howto/logging_flow.png*
      -rw-r--r--  1 inada-n  staff  11158  7  1 02:28 library/depgraph-output.png
      -rw-r--r--  1 inada-n  staff  10590  7  1 02:28 library/hashlib-blake2-tree.png
      -rw-r--r--  1 inada-n  staff   6168  7  1 02:28 library/pathlib-inheritance.png
      -rw-r--r--  1 inada-n  staff  33565  7  1 02:28 library/tulip_coro.png
      -rw-r--r--  1 inada-n  staff  29964  7  1 02:28 library/turtle-star.png
      -rw-r--r--  1 inada-n  staff  37942  7  1 02:28 using/win_installer.png
    7. methane commented on Jun 30, 2018

      @methane
      methane
      on Jun 30, 2018
      Member
      More actions

      03:19 $ find . -name '*.png' | xargs optipng -o7
      03:20 $ ll **/*.png
      -rw-r--r-- 1 inada-n staff 2888 7 1 03:20 faq/python-video-icon.png
      -rw-r--r-- 1 inada-n staff 22058 7 1 03:20 howto/logging_flow.png
      -rw-r--r-- 1 inada-n staff 11146 7 1 03:20 library/hashlib-blake2-tree.png
      -rw-r--r-- 1 inada-n staff 6456 7 1 03:20 library/pathlib-inheritance.png
      -rw-r--r-- 1 inada-n staff 36812 7 1 03:20 library/tulip_coro.png
      -rw-r--r-- 1 inada-n staff 33808 7 1 03:20 library/turtle-star.png
      -rw-r--r-- 1 inada-n staff 42117 7 1 03:20 using/win_installer.png

      While this output is bigger than PR-2141, I think it's good enough.

    8. methane commented on Jul 1, 2018

      @methane
      methane
      on Jul 1, 2018
      Member
      More actions

      New changeset c6cd164 by INADA Naoki in branch 'master':
      bpo-30660: Doc: Optimize PNG files by optipng (GH-8032)
      c6cd164

    9. methane
      added
      3.8 (EOL)end of lifeend of life
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      and removed
      3.7 (EOL)end of lifeend of life
      on Jul 1, 2018
    10. methane
      closed this as completedon Jul 1, 2018
    11. methane
      assigned
      docspython
      on Jul 1, 2018
    12. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirperformancePerformance or resource usagePerformance or resource usage

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402520 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.