mirror of
				https://github.com/sahinakkaya/til.git
				synced 2025-07-17 14:01:49 +03:00 
			
		
		
		
	TIL: Manipulating images
This commit is contained in:
		
							
								
								
									
										7
									
								
								command-line-utils/manipulating-images.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								command-line-utils/manipulating-images.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					You can use `convert` to crop or resize your images. Let's say you have an image with size of `800x600` and you want to crop 100 px from left, 100 px from right and then resize it to `200x200`. Here are the commands you would run:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					convert original.jpg -crop 700x600+100+0 cropped.jpg # Crop from left. 100+0 is offset from top left corner.
 | 
				
			||||||
 | 
					convert cropped.jpg -crop 600x600+0+0 cropped.jpg 
 | 
				
			||||||
 | 
					convert cropped.jpg -resize 200x200 final.jpg
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
		Reference in New Issue
	
	Block a user