Skip to content

Commit f40f233

Browse files
authored
Update README.md
1 parent 0124c5d commit f40f233

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

+50
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ npm install jpg-js
2525
<li><a href="#grey">Greyscale image</a></li>
2626
<li><a href="#array">Image From Array</a></li>
2727
<li><a href="#rotate">Rotate Image</a></li>
28+
<li><a href="#flip">Flip Image</a></li>
2829
</ul>
2930

3031

@@ -239,6 +240,55 @@ img.save("image.jpg")
239240
<img src="https://user-images.githubusercontent.com/88069082/149702534-88d48d0d-d1c4-44d7-8fea-f81c382f4d90.jpg" height="800px"/>
240241
</p>
241242

243+
<h2 id="flip">Flip Image</h2>
244+
245+
```javascript
246+
// Horizontal Flip
247+
const Image = require("jpg-js");
248+
249+
img = Image.open("img.jpg");
250+
251+
//Flipping image horizontally
252+
img.flip_horizontal();
253+
254+
//Saving processed image as horizontal.jpg
255+
img.save("horizontal.jpg")
256+
```
257+
258+
```javascript
259+
// Vertical Flip
260+
const Image = require("jpg-js");
261+
262+
img = Image.open("img.jpg");
263+
264+
//Flipping image vertically
265+
img.flip_vertical();
266+
267+
//Saving processed image as vertical.jpg
268+
img.save("vertical.jpg")
269+
```
270+
271+
**Actual Image (img.jpg)**
272+
273+
<p align="center">
274+
<img src="https://user-images.githubusercontent.com/88069082/149720631-7e31bd11-f739-4bc7-a065-7bd1f6101793.jpg"/>
275+
</p>
276+
277+
278+
**Horizontal Flip Image (horizontal.jpg)**
279+
280+
<p align="center">
281+
<img src="https://user-images.githubusercontent.com/88069082/149720628-95a2d5f2-2a62-464d-aa18-663de7b9c713.jpg"/>
282+
</p>
283+
284+
285+
**Verticall Flip Image (vertical.jpg)**
286+
287+
<p align="center">
288+
<img src="https://user-images.githubusercontent.com/88069082/149720894-58bda67d-dc11-4df3-a4f6-7d0124eb4718.jpg"/>
289+
</p>
290+
291+
242292
## License
243293

244294
### Decoding

0 commit comments

Comments
 (0)