How to crop a image by using python

How to crop a image by using python 


In this blog and video,I am going to tell how to crop a image by using python script. The source code of this program is very simple and easy.I am going to use pillow package to implement this program.

Source Code:
1)Go to pycharm
2)File->setting->project->project Interpreter->Click + button->type pillow->Install the pakage
3)copy the image paste in file location
4)follow the code

from PIL import Image
img = Image.open("shelly.jpg")
area=(350, 5, 1000, 500)#crop sizecrop1=img.crop(area)
img.show()
crop1.show()



PIL : python 2.4 version
Pillow : python above 2.4 version

I hope you understood this program and if you have any doubt or suggestion tell me in youtube comment box 

support me for more videos and blogs by Karthick Aravindan
















Comments

  1. I'm on the fence about this, while more customization is good, I have a feeling this is a "in-progress" update, it just feels incomplete and half-way there.
    We use badge layout for apps on design approvals (visual projects), so the image being displayed is important. Old layout "feels like" it had larger images,
    maybe because the images were cropped more loosely so it's easier to tell which project it was at quick glance. Now the image is cropped closer, making it
    harder to scan thru at quick glance. I find myself needing to click into the project more often than usual. Which makes the whole user experience less
    efficient.
    I have a couple suggestions that might make it work better:
    1. Increase the height of the window the cover image is being displayed.
    2. Let us to choose which image to be displayed as "cover" (like how Pinterest handles cover images of each board, was hoping for this for a long time)
    3. Let us adjust which part of the image to show and how tight or loose the crop is (with a fixed window, let us move the image around and maybe enlarge or
    shrink it to control what shows thru the window. Pinterest does a limited form of this, which is very useful in making the cover image relevant)
    4. Allow Cover Image to be ordered in different hierarchy (currently every element can be ordered differently except the Cover Image, it seems to be stuck
    in the 2nd spot, would like the option to set it on another spot in the layout. This one seems like an easy fix, since you guys allow that for every other
    element already)

    ReplyDelete

Post a Comment

Popular posts from this blog

Artificial Intelligence

The taxonomy of CASE Tools

Zoho Second round - adding a digit to all the digits of a number