Skip to content

Instantly share code, notes, and snippets.

View dqureshiumar's full-sized avatar
🎯
Focusing

Umar Qureshi dqureshiumar

🎯
Focusing
View GitHub Profile
@dqureshiumar
dqureshiumar / adamatrix.py
Created September 16, 2020 10:51
Codechef September Challenge 2020 Div 2 - Ada Matrix Problem
# cook your dish here
T = int(input())
# Test Cases Iteration
for __ in range(T):
N = int(input())
listi = []
i,j = 0,0
cntt = 0
count_on_me = 0
#Accept Two Dimensional List in Python
@dqureshiumar
dqureshiumar / gist:1ff71c5643ff531f5d41a6ad88f84ef2
Created November 12, 2025 20:40
Image Conversion from JPG/PNG to WebP with size reduction
import os
from PIL import Image
from concurrent.futures import ThreadPoolExecutor, as_completed
# ====== CONFIGURATION ======
TARGET_KB = 100 # desired max size per image (in KB)
FORMATS = (".jpg", ".jpeg", ".png") # image formats to process
CONVERT_TO = "WEBP" # output format (WEBP, JPEG, etc.)
DELETE_ORIGINAL = False # set True to remove old images
MAX_WORKERS = 8 # number of parallel threads