Skip to content

Commit

Permalink
Removing the .adoc file and modified existing README.rst itself
Browse files Browse the repository at this point in the history
  • Loading branch information
kasturinarra committed Sep 16, 2022
1 parent a264df2 commit 2325b05
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@ You need to specify input and output directories using the `-v` flag to `docker
fnndsc/pl-optipng optipng \
/incoming /outgoing
Follow steps below to reduce the size of a png file or any other external formats mentioned above into a optimized png
----------------------------------------------------------------------------------------------------------------------

- 1.clone repo ``https://github.com/rh-impact/pl-optipng`` by running the command ``git clone https://github.com/rh-impact/pl-optipng``
- 2.Now ``cd`` to the cloned repo
- 3.create a directory called ``in`` inside the repo
- 4.create another directory called ``out`` inside the repo
- 5.In the ``in`` directory download any ``.png`` files and note down their sizes
- 6. Now build the ``Dockerfile`` inside the directory by running the command ``docker build -t local/pl-optipng .``
- 7. With out using the interactive shell you could run the command below to see the size of png file reduced

.. code:: bash
docker run --privileged --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing localhost/local/pl-optipng optipng /incoming /outgoing
- If you would like to use the interactive shell run the commands below to see the size of png file reduced

.. code:: bash
- docker run --privileged --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing -it localhost/local/pl-optipng /bin/bash
- /usr/bin/optipng --help
- /usr/bin/optipng -dir <outputdir> -- <absolutepath of input png file> (or)
- /usr/bin/optipng <absolutepath of png file>
Development
-----------
Expand All @@ -101,6 +126,25 @@ Run unit tests:
docker run --rm local/pl-optipng nose2
Sample Outputs
--------------

.. code:: bash
Processing: Sample-png-image-20mb.png
5891x2271 pixels, 4x8 bits/pixel, RGB+alpha
Reducing image to 3x8 bits/pixel, RGB
Input IDAT size = 21134274 bytes
Input file size = 21141605 bytes
Trying:
zc = 9 zm = 8 zs = 0 f = 5 IDAT size = 17612792
zc = 9 zm = 8 zs = 1 f = 5 IDAT size = 17248219
Selecting parameters:
zc = 9 zm = 8 zs = 1 f = 5 IDAT size = 17248219
Output IDAT size = 17248219 bytes (3886055 bytes decrease)
Output file size = 17251686 bytes (3889919 bytes = 18.40% decrease)
Examples
--------

Expand Down

0 comments on commit 2325b05

Please sign in to comment.