Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # b_resize_function.py
- # to resize (w,h) to fit the target area size
- def resize(w, h, target_area):
- ratio = (target_area / (w * h))**0.5
- return int(w * ratio), int(h * ratio)
- ww = 900
- hh = 1600
- j = int((ww/2)*(hh/2))
- while 1:
- i = resize(ww,hh,j)
- if i[0] > ww*2:
- break
- else:
- print(i,j)
- j += 200000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement