Skip to content

Commit 52eec8c

Browse files
committed
Removing the .adoc file and modified existing README.rst itself
1 parent a264df2 commit 52eec8c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,30 @@ You need to specify input and output directories using the `-v` flag to `docker
8585
fnndsc/pl-optipng optipng \
8686
/incoming /outgoing
8787
88+
Follow steps below to reduce the size of a png file or any other external formats mentioned above into a optimized png
89+
----------------------------------------------------------------------------------------------------------------------
90+
- clone repo ``https://github.com/rh-impact/pl-optipng`` by running the command ``git clone https://github.com/rh-impact/pl-optipng``
91+
- Now ``cd`` to the cloned repo
92+
- create a directory called ``in`` inside the repo
93+
- create another directory called ``out`` inside the repo
94+
- In the ``in`` directory download any ``.png`` files and note down their sizes
95+
- Now build the ``Dockerfile`` inside the directory by running the command ``docker build -t local/pl-optipng .``
96+
- With out using the interactive shell you could run the command below to see the size of png file reduced
97+
98+
.. code:: bash
99+
100+
docker run --privileged --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing localhost/local/pl-optipng optipng /incoming /outgoing
101+
102+
- If you would like to use the interactive shell run the commands below to see the size of png file reduced
103+
104+
.. code:: bash
105+
106+
- docker run --privileged --rm -v $(pwd)/in:/incoming -v $(pwd)/out:/outgoing -it localhost/local/pl-optipng /bin/bash
107+
- /usr/bin/optipng --help
108+
- /usr/bin/optipng -dir <outputdir> -- <absolutepath of input png file> (or)
109+
- /usr/bin/optipng <absolutepath of png file>
110+
111+
88112
89113
Development
90114
-----------
@@ -101,6 +125,25 @@ Run unit tests:
101125
102126
docker run --rm local/pl-optipng nose2
103127
128+
Sample Outputs
129+
--------------
130+
131+
.. code:: bash
132+
133+
Processing: Sample-png-image-20mb.png
134+
5891x2271 pixels, 4x8 bits/pixel, RGB+alpha
135+
Reducing image to 3x8 bits/pixel, RGB
136+
Input IDAT size = 21134274 bytes
137+
Input file size = 21141605 bytes
138+
Trying:
139+
zc = 9 zm = 8 zs = 0 f = 5 IDAT size = 17612792
140+
zc = 9 zm = 8 zs = 1 f = 5 IDAT size = 17248219
141+
142+
Selecting parameters:
143+
zc = 9 zm = 8 zs = 1 f = 5 IDAT size = 17248219
144+
Output IDAT size = 17248219 bytes (3886055 bytes decrease)
145+
Output file size = 17251686 bytes (3889919 bytes = 18.40% decrease)
146+
104147
Examples
105148
--------
106149

0 commit comments

Comments
 (0)