Skip to content

Commit

Permalink
changed 'orient' to 'group'
Browse files Browse the repository at this point in the history
  • Loading branch information
rysuds committed Jun 8, 2020
1 parent 501f2d2 commit 68c62f7
Show file tree
Hide file tree
Showing 7 changed files with 2,100 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exsprite/core/sprite_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def get_labeled_for_rows(labeled, row_tups):
# TODO allow foldername kwarg
# TODO allow for col/row selection
class SpriteSheet(object):
def __init__(self, filename, background=0, orient='row'):
def __init__(self, filename, background=0, group='row'):
self.filename = filename
self.foldername = f"{filename.split('.')[0]}_groups"
self.img = io.imread(filename)
self.orient=orient
if self.orient=='col':
self.group=group
if self.group=='col':
self.img=transpose(self.img)
self.background=background
self.boolean_image=None
Expand Down Expand Up @@ -92,7 +92,7 @@ def save(self):
minr, maxr = int(min(rrow)), int(max(rrow))
minc, maxc = int(min(rcol)), int(max(rcol))
sub_image = self.img[minr:maxr+1,minc:maxc+1]
if self.orient=='col':
if self.group=='col':
sub_image = transpose(sub_image)
#show(sub_image,50)
io.imsave(filename,sub_image,check_contrast=False)
Binary file added samples/skelly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,096 changes: 2,096 additions & 0 deletions sprite_sheet_rough.ipynb

Large diffs are not rendered by default.

Binary file added tmp/img1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmp/img2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmp/img3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmp/img4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 68c62f7

Please sign in to comment.