Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bassemhalim/shopify-bulk-image-resize

resize all shopify product images to be square 2048x2048 filling the background black
https://github.com/bassemhalim/shopify-bulk-image-resize

pillow python3 shopify shopify-api

Last synced: 18 days ago
JSON representation

resize all shopify product images to be square 2048x2048 filling the background black

Awesome Lists containing this project

README

        

I had a lot of rectangular product images on shopify that where already uploaded and assigned to products that didn't look right on the website (were being cropped to be square) because the recommended product image size is 2048x2048.

There was no shopify feature to bulk resize images. In addition, the images had to be filled and croped because they were rectangular. Luckly the image background was pure black so it was easy to fill the missing part of the image black

This script checks every product image and if the image is rectangular or square but not 2048x2048 it will:
- download the image
- resize it to 2048x2048
- fill background black (0,0,0)
- update product image

for the shopify api you only need the store url and the store access token with product read and write permissions
to get the token go to Apps and Sales channel > Develop Apps > create an App

Before:\
5568 × 3712 \

After:\
2048 x 2048\