BARTULA CODE

Crop images by transparent

I was looking for script which allows crop iamges by their transparency.
Python comes with help.
You only need to instal PIL librarry

pip install pillow

Script:
Croppes *.png files in current directory, and save under ./cropped directory (you need to create it firstly)

from PIL import Image
import os

def crop_to_content(file_name,file_output):
    image=Image.open(file_name)
    imageBox = image.getbbox()
    cropped=image.crop(imageBox)
    cropped.save(file_output)

if __name__ == '__main__':
    directory = r'.'
    for filename in os.listdir(directory):
        if filename.endswith(".png"):
            crop_to_content(filename, "./cropped/"+filename)
        else:
            continue

Read more

Windows Use UTC Time

ctrl+R -> RegEdit -> enter Registry: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation Key: RealTimeIsUniversal Type: DWORD (32-bit) Value. Value: 1 Then restart PC

Extend »
HTTP 204 - No Content