Code Monkey home page Code Monkey logo

split-image's Introduction

Minas's GitHub stats

split-image's People

Contributors

jungyitsai avatar kimtth avatar lyntny4n avatar mcdominik avatar pauldebus avatar whiplashoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

split-image's Issues

joined image will lost alpha info

Hi whiplashoo,

Joined image will lost alpha info (was 32 bits, becomes 24 bits after joining).

Works fine with split method: alpha info will be reserved correctly after splitting.

Thank you.

I dont know what happen to me.

split-image ./Knob333.png 128 1
Exporting image tile: ./Knob333_0.png
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/PIL/ImageFile.py", line 518, in _save
fh = fp.fileno()
AttributeError: '_idat' object has no attribute 'fileno'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/split-image", line 33, in
sys.exit(load_entry_point('split-image==2.0.1', 'console_scripts', 'split-image')())
File "/usr/local/lib/python3.10/site-packages/split_image/split.py", line 173, in main
split_image(image_path, args.rows, args.cols,
File "/usr/local/lib/python3.10/site-packages/split_image/split.py", line 56, in split_image
outp.save(outp_path)
File "/usr/local/lib/python3.10/site-packages/PIL/Image.py", line 2431, in save
save_handler(self, fp, filename)
File "/usr/local/lib/python3.10/site-packages/PIL/PngImagePlugin.py", line 1420, in _save
ImageFile._save(im, _idat(fp, chunk), [("zip", (0, 0) + im.size, 0, rawmode)])
File "/usr/local/lib/python3.10/site-packages/PIL/ImageFile.py", line 522, in _save
_encode_tile(im, fp, tile, bufsize, None, exc)
File "/usr/local/lib/python3.10/site-packages/PIL/ImageFile.py", line 533, in _encode_tile
encoder.setimage(im.im, b)
SystemError: tile cannot extend outside image

OS: Macos 12.6.3
Python:3.10

Doesn't work on Jupyter notebooks

I have tested the code on terminal and the package works as expected and with given example. The only issue so far is that the same code doesn't work on jupyter notebook.

is there a way to use it in python script?

Hi:) I need to slice my images accordingly to some kind of algorithm, so terminal usage is cumbersome.
Is there a way to do it similar to this pseudocode?

from split-image import Slicer

list_of_slices = Slicer('myimage.jpg', rows_num, col_num)

Feature Request: Batch Processing & Directory Saving

Anyway to batch process/split images? Saving splits to a different directory?

Maybe there is an easy way to do this already by piping filenames to "split-image"?

Thanks!

  • Batch processing multiple images

  • Set a custom output directory

Output directory format

Hello
I want to split an image and place the result in a Split directory.
My script

import cv2
from split_image import split_image

split_image("Eau1_gray.jpg",1,8, False, False, |'Split'])

cv2.waitKey(0)
cv2.destroyAllWindows()

do not work. Split is OK but in the current directory

image orientation

this doesn't seem to support the image orientation (rotation?) tag in images, at least on windows

so for example, using canon camera, turning the camera to take a vertical image -- the image looks ok within windows and image apps, but when running split on it, the source image is obviously taken as landscape instead of portrait orientation and hence the resulting pieces don't match expectations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.