Git Product home page Git Product logo

image-optimizer's Introduction

image-optimizer

Optimize any image using techniques like chroma subsampling and optimized huffman coding etc.

Introduction

Images we capture today, contains so much extra information that is not needed.
And also our human eye have some limitations.
So, removing what our eyes can't see is the basic idea.
Our eye is high sensitive to 'luma' than 'chroma'. So, according to that, image can be optimized.

Advantage

The biggest advantage is image resolution is not changed during this optimization process.
Means if at first image is of size 1458 x 2592, then after optimization process, image resolution will be same 1458 x 2592.
But image size will be decresed or will remain same (if already optimized).

And also, image format is also kept same. png images will be kept png, jpeg images will be kept jpeg.

Setup

Frameworks and Packages

Make sure you have the following is installed:

Usage

Give image path by command line argument.

python optimizer.py IMAGE_PATH

Give relative image path inplace of IMAGE_PATH

Sample performance

  • Before size : 135 KB. Resolution : 1200 x 675

befimg1


after size : 119 KB. Resolution : 1200 x 675
Resolution is still same. But size is decresed.

befimg1

  • Before size : 3358 KB. Resolution : 4208 x 2368

befimg1


after size : 960 KB. Resolution : 4208 x 2368
Resolution is still same. But size is decresed by ~70%

befimg1

  • Before size : 1482 KB. Resolution : 2592 x 1458

befimg1


after size : 396 KB. Resolution : 2592 x 1458
Resolution is still same. But size is decresed by ~70%

befimg1

  • Before size : 566 KB. Resolution : 2000 x 1125

befimg1


after size : 331 KB. Resolution : 2000 x 1125
Resolution is still same. But size is decresed.

befimg1

Future improvements

Average time for optimizing a 1280 x 720 image is around 2 minutes. That is very long.
I will try to reduce that time.

image-optimizer's People

Contributors

prashant-kikani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

myjere kavya-kavs

image-optimizer's Issues

Visual artifacts on the sample optimized images

I noticed that two of the sample optimized images shown in the Readme file have noticeable visual artifacts, that in my opinion shouldn't be present. Please take a look at this screenshot of a detail from p1_opti_by_pkikani.jpeg:

captura de ecra 2018-10-09 as 10 53 21

And this one from m2_opti_by_pkikani.jpg:
captura de ecra 2018-10-09 as 10 55 55

Notice that dust-like scattered pixels? I am not sure what is causing them, but unless the optimized images are meant to be used in very low resolution, it may be a problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.