Skip to content

Commit

Permalink
Mark settings're in px 'n arrange custom size up
Browse files Browse the repository at this point in the history
  • Loading branch information
BirkhoffLee committed Feb 9, 2017
1 parent 260a995 commit 3777dc8
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions extract.py
Expand Up @@ -9,11 +9,15 @@
outputDirSticker = "./output/sticker/"
outputDirCustom = "./output/custom/"

# Custom-sized
wantedImageSize = (180, 180) # The actual image size (px)
wantedStickerSize = (100, 100) # The sticker's size in the actual image (px)

###

sticker_width = 288
sticker_height = 288
sticker_offset = 24
sticker_width = 288 # (px)
sticker_height = 288 # (px)
sticker_offset = 24 # (px)

###

Expand All @@ -38,21 +42,15 @@

# Full-sized version
cropped.save(outputDirFull + str(count) + ".png")
####

# Sticker-sized version
cropped.thumbnail((120, 120))
cropped.save(outputDirSticker + str(count) + ".png")
####

# Customized-sized version
wantedDaveSize = (100, 100)
wantedImageSize = (180, 180)

offset_width = (wantedImageSize[0] - wantedDaveSize[0]) / 2
offset_height = (wantedImageSize[1] - wantedDaveSize[1]) / 2
cropped.thumbnail(wantedDaveSize)
# Custom-sized version
offset_width = (wantedImageSize[0] - wantedStickerSize[0]) / 2
offset_height = (wantedImageSize[1] - wantedStickerSize[1]) / 2
cropped.thumbnail(wantedStickerSize)
new = Image.new("RGBA", wantedImageSize, (0, 0, 0, 0))
new.paste(cropped, (offset_width, offset_height))
new.save(outputDirCustom + str(count) + ".png")
####

2 comments on commit 3777dc8

@Arjun877
Copy link

@Arjun877 Arjun877 commented on 3777dc8 Mar 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stickers

i want to make a gif of this one, but i am not understanding how to do it here in this website, please help.

@BirkhoffLee
Copy link
Owner Author

@BirkhoffLee BirkhoffLee commented on 3777dc8 Mar 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Arjun877 Please make an issue instead of commenting below the commit.

Please sign in to comment.