hanzhi713 / image-collage-maker

A photo mosaic (pixel collage) maker. Use all your friends' profile pictures to approximate your profile picture! 如何用 Python 制作一个炫酷的微信好友图
MIT License
157 stars 13 forks source link

Problem with `--resize_opt center` not cropping the tile image into Square #27

Closed fearocanity closed 1 year ago

fearocanity commented 1 year ago

Context: I'm trying to work with 100+ images, And I want the tiles to be squared. But the option that was referred for my expected result is not working nor doesn't do its functionality. (BTW, I'm running it in Ubuntu 18). And also I'm using the latest version of this tool.

Based on your readme guide of --resize_opt:

How to resize each tile so they become square images. Center: crop a square in the center. Stretch: stretch the tile (default: center)

My options:

...
  --path ../imgs \
  --dest_img img.jpg \
  --size 50 \
  --dup 1 \
  --blending alpha \
  --blending_level 0.25 \
  --resize_opt center \
  --freq_mul 0.1 \
  --max_width 85 \
  --unfair \
  --deterministic \
  --out out.png

(Cropped) Output: image

fearocanity commented 1 year ago

dupe #11 But the fix doesn't work in my side either

hanzhi713 commented 1 year ago

@fearocanity Sorry for the late reply. This is not a bug, but probably caused by my misleading documentation on this. --resize_opt center will crop the largest rectangle from the center to fit the aspect ratio of the tile width and height, either specified or inferred.

TLDR; If you want each tile to be a square, specify the size like this: --size 50 50

fearocanity commented 1 year ago

@fearocanity Sorry for the late reply. This is not a bug, but probably caused by my misleading documentation on this. --resize_opt center will crop the largest rectangle from the center to fit the aspect ratio of the tile width and height, either specified or inferred.

TLDR; If you want each tile to be a square, specify the size like this: --size 50 50

Sorry, probably my english comprehension is too bad😅 I will give my feedback later!! Thanks for responding! I tested it just now too, and it works now.