question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No effect with quality 100?

See original GitHub issue

Using the Image Actions GitHub Action, which uses sharp (with mozjpeg), I get identically compressed files with quality 80 and with quality 100.

What is the output of running npx envinfo --binaries --languages --system --utilities?

Unknown.

What are the steps to reproduce?

PR 1: quality 80

PR https://github.com/hugovk/python-logos/pull/1 adds the default workflow in .github/workflows/calibreapp-image-actions.yml from:

https://github.com/calibreapp/image-actions#how-to-add-this-to-your-repository

name: Compress images
on: pull_request
jobs:
  build:
    name: calibreapp/image-actions
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: calibreapp/image-actions
        uses: docker://calibreapp/github-image-actions
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

By default, it uses quality 80.

PR 2: quality 100

PR https://github.com/hugovk/python-logos/pull/2 is the same, but with this config in .github/calibre/image-actions.yml:

jpeg:
  quality: 100
png:
  quality: 100
webp:
  quality: 100

And the action read in the config:

->> Using config: {"jpeg":{"quality":100},"png":{"quality":100},"webp":{"quality":100},"ignorePaths":["node_modules/**"]}

https://github.com/hugovk/python-logos/runs/295767221#step:4:7

However, the images in both PRs are binary identical:

image

This is surprising, should the images with 100 quality be lossless? I’d expect at least some difference.

What is the expected behaviour?

Lossless change to images with quality 100. At least I’d expect the files in each PR not to be identical.

Are you able to provide a standalone code sample, without other dependencies, that demonstrates this problem?

No, I was referred to report the issue here by the Image Actions maintainers (https://github.com/calibreapp/image-actions/issues/25).

Are you able to provide a sample image that helps explain the problem?

Yes, the images above are in https://github.com/hugovk/python-logos/tree/master/img.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Nov 24, 2019

@hugovk I hope this information helped. Please feel free to re-open with more details if further help is required.

0reactions
lovellcommented, Nov 20, 2019

@benschwarz Looks good. It’s worth noting that libimagequant is GPL licenced (and not LGPL) so this change will make all your GitHub Action code GPL as it runs in the same process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

There is no effect when setting quality of JPEG compression in ...
There is no effect when setting quality of JPEG compression in CGImageDestination in Apple's Core Graphics/ ImageIO framework.
Read more >
What does JPG Quality Losses Mean? - Scanning Tips
However, these JPG Quality values are not absolute numbers, and Quality 100 may be hard to fault, but it does NOT mean 100%...
Read more >
What effect does imwrite(I,'test.jpg','Quality',100) in matlab ...
As per imwrite documentation ('Quality',100) pair means no compression but I get a psnr around 59. I expect psnr value = inf. Can...
Read more >
Tutorial: Estimate JPEG Quality - FotoForensics
An image at 100% quality has (almost) no loss, and 1% quality is a very low quality image. In general, quality levels of...
Read more >
JPEG quality comparison: 80% vs. 90% - Sirv
90% JPEG quality gives a very high-quality image while gaining a significant reduction on the original 100% file size. 80% JPEG quality gives...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found