About 729,000 results
Open links in new tab
  1. python - Reshaping rectangular image to square - Stack Overflow

    Apr 20, 2017 · The following solution keep the center part of the image as a square. def resize_image(self, image: Image, length: int) -> Image: """ Resize an image to a square. Can …

  2. PIL: Thumbnail and Square Image Generation in Python 3

    Jan 13, 2025 · In this topic, we explored how to generate thumbnail and square images using the Python Imaging Library (PIL) in Python 3. We learned how to use the thumbnail() method to …

  3. Generate square or circular thumbnail image with Python - Pillow

    Mar 17, 2021 · Usually, the shape of the thumbnail is dependent on the original image, but in this article, we are going to generate the circular and square thumbnail image using Pillow Library …

  4. How to Draw a Square in Python using OpenCV - Learning about …

    In this article, we show how to draw a square in Python using the OpenCV module. OpenCV allows a user to create a wide variety of shapes, including rectangles, squares, circles, etc. …

  5. Resizing images into squares with OpenCV and Python

    Oct 30, 2019 · print("Saving image with dims: " + str(crop_img.shape[0]) + "x" + str(crop_img.shape[1])) cv2.imwrite("collections/128/" + str(i) + '.jpg', crop_img) i += 1 except: …

  6. Python — Converting Non-Square Images To Square Images

    Feb 26, 2023 · Instagram automatically crops your images (ew) to either 1) a square shape 2) 4:5 aspect ratio or 3) 9:16 aspect ratio; So I need a way to add white padding to my images such …

  7. GitHub - DrakeDong0/square-image-maker: This is a Python

    This is a Python script that will crop or resize your .png or .jpg files into a square. Duplicate results are overwritten. I made this short program because I got lazy cropping each image for my …

  8. How to draw shapes on images with Python (PIL): The Ultimate …

    Using Python’s ImageDraw module we can draw square shapes on any image and any coordinate on that image. We can also specify a fill color or outline color and we can even adjust …

  9. How do I make rectangular image squared using OpenCV and Python?

    Aug 12, 2017 · For Grayscale images replace these lines: height, width = img.shape print (in_img,height, width) square = np.ones((x,y), np.uint8) * value Where 'value' is the greyscale …

  10. Python – Using Pillow to generate images programmatically

    Jan 7, 2024 · Pillow, an offshoot of the Python Imaging Library (PIL), simplifies image processing tasks in Python. In this tutorial, we’ll explore how to use Pillow to generate images, manipulate …

  11. Some results have been removed
Refresh