Comments (3)
Can you upload an image that would benefit from this?
To some extent pngquant already does this, as it applies different weight to edges and noisy areas of the image. I could add option to take arbitrary image mask that marks which areas of the image are most important. Would you use such feature?
from pngquant.
I would need to know more about how to embed" image mask" into the image. What would I need to do to have images work with this feature? Currently I am thinking more in terms of giving coordinate of bounding boxes as input to pngquant, but you have some better ideas, I am open to explore the options. My toolset is imagemagick and python's Pillow library. Obviously I'm not an expert, so you may have to elaborate a bit on how to take advantage of the feature.
As for benefits of having this feature, an easy example that would benefit from this are any publication-related scans, mockups that are found most in traditional media. I am working with some really old archives of scans and
I currently do not have the domain knowledge to make any available compression tool (imagemagick, pil or pngquant) to distinguish text from photos in a picture.
Currently if I run pngquant with quality 110, I can get readable text with a compression ratio of 3. (uncompressed/compressed) But the photos will look very zombie-like. I could only get out of the lossy zombie effect with quality above 60, about 6080 bound. That pushes the compression ratio down to only 1.4. Given the fact that the majority of scans are text, I am thinking that I could have the best of both worlds to keep the compression ratio at around 2.5 without losing much photo quality. I think that would be a win-win situation and makes sense for png compression strategy since text should take less color index than photos, line arts, and drawings.
A news article today just covered on museum of comic scans: http://news.yahoo.com/comics-lovers-drawn-ohio-museum-153218717.html
I am sure comic scans can benefit from this as well.
Here are some results from google search:
http://media.smashingmagazine.com/wp-content/uploads/2011/09/newspaper-website.png
from pngquant.
I see. In that case pngquant is pretty smart already and will avoid putting too much weight on anti-aliasing of text β specifying of areas of interest won't help much.
I think compression could be improved a bit if pngquant was lossy beyond limiting number of colors in the palette, but this could be done mostly automatically (but it's much more complicated, maybe I'll implement it⦠someday).
If you know coordinates of photos in the picture you may get best results if you cut photos out and store them as JPEG, and the rest as PNG (with photos blacked out).
If you can use any format, then check out DjVu format which already does this kind of text-vs-photo separation automatically.
from pngquant.
Related Issues (20)
- on windows pngquant directs output to stderr not stdout HOT 1
- Feature Request: Option to skip image if it already has 256 colors or less. HOT 2
- tar error while installing with brew on macos HOT 3
- OpenMP warning on Clang systems HOT 1
- Windows Build - Executing from current directory should include exclusion for pngquant.exe HOT 1
- Using more than 4 bits per channel with posterization HOT 3
- Is it possible to keep fully transparent (0 alpha) areas of image fully transparent? HOT 2
- Supported on Apple silicon? HOT 1
- Option to preserve color for fully transparent pixels HOT 1
- Feature Request: Option to select default output directory in PNGoo HOT 1
- not create .exe after build HOT 3
- missing malloc fail check in read_chunk_callback HOT 1
- How to add code-coverage compile flag such as -fprofile-arcs -ftest-coverage HOT 1
- Document `--map` argument HOT 2
- Homebrew Version HOT 2
- `c49cb1f` ("OOM checks") not applied to `3.x` / `main` branch
- Converting not work on Mac php without any message
- Linux and MacOS have different results HOT 1
- PNGoo doesn't have a icon
- PNGquant.py to APP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pngquant.