samdobson / image_slicer

Split images into tiles. Join the tiles back together.
http://samdobson.github.io/image_slicer
MIT License
151 stars 73 forks source link

Fix so that join works #20

Closed chughts closed 5 years ago

chughts commented 5 years ago

join-tiles

helpers.py

main.py

chughts commented 5 years ago

@samdobson Just want to ping you, in case you hadn't seen this pull request.

Inrixia commented 5 years ago

Tried using this merge from your repo but getting

File "C:\Users\Inrix\AppData\Local\Programs\Python\Python36\lib\site-packages\image_slicer\main.py", line 95, in join
    im.paste(tile.image, tile.coords)
AttributeError: 'PngImageFile' object has no attribute 'image'.

Any suggestion on how to fix the join functionality to work @chughts would like to use it for a project

chughts commented 5 years ago

@Inrixia This is my text script, with a hard-coded path to ./images to find the images it needs to join.


#!/usr/bin/env python

import os
from image_slicer import join, open_images_in

image = join(open_images_in(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'images')))
image.save(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'images', 'joined.png'))
Inrixia commented 5 years ago

@chughts Works! Thanks <3

Also had to make sure that the filename had not been changed, as the images I was using had _rlt appended to them which had to be removed before merging.

samdobson commented 5 years ago

@chughts Many thanks for this. Merged.