Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create mosaic using human face image (tile image) #46

Open
arnabdasdigerati opened this issue Oct 30, 2023 · 5 comments
Open

Comments

@arnabdasdigerati
Copy link

I am not able to create mosaic using human faces. I am using human faces as tiles. it is generating something else not as the main cover image. can you please guide me regarding this ?

@nuno-faria
Copy link
Owner

Hello, could you show me the commands that you are using to generate the image?

@arnabdasdigerati
Copy link
Author

arnabdasdigerati commented Oct 31, 2023

yes, below mentioned command I have used to generate mosaic.

command: python tiler.py images/ssp-bnr-img.jpg tiles/tile_image/

I am rendering main image - ssp-bnr-img.jpg from image folder and tile images from tile/tile_image folder. tile_image folder is having 128x128 dimension human face images.

I am using below configurations-
COLOR_DEPTH = 32
RESIZING_SCALES = [0.5, 0.4, 0.3, 0.2, 0.1]
PIXEL_SHIFT = (10, 10)
OVERLAP_TILES = False
POOL_SIZE = 12
OUT = 'out.png'
IMAGE_TO_TILE = None
TILES_FOLDER = None

Please guide me to fix the issue. Thank you.

@nuno-faria
Copy link
Owner

For your particular use case, I would recommend using a grid pattern, i.e., setting the pixel shift to none and using a single scale.
Example:

RESIZING_SCALES = [0.1]
PIXEL_SHIFT = None

If the tiles are too small for the image, you can try increasing the RESIZING_SCALES. If on the other hand the tiles are too big in the final image, you can try decreasing the RESIZING_SCALES to something like 0.05.

Let me know if this works for you.

@arnabdasdigerati
Copy link
Author

arnabdasdigerati commented Oct 31, 2023

out

it is generating the mosaic. But when zoom out the output image file, small file images are also getting pixelated. tile images are not clear. Color of whole output image also it got damaged.

Above I have attached the output image file for your reference. Can you please guide to fix this ?

@nuno-faria
Copy link
Owner

To be able to see each tile clearly while keeping each tile small, we have to scale up the image to tile.
I just added a new parameter called IMAGE_SCALE to achieve that. For your case, you can start with something such as this:

IMAGE_SCALE = 5
RESIZING_SCALES = [1]
PIXEL_SHIFT = None

If you find that each tile is too big, you can increase the IMAGE_SCALE.
Let me know if this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants