Skip to content

Commit

Permalink
Merge branch 'master' into glaze
Browse files Browse the repository at this point in the history
  • Loading branch information
TenteEEEE committed Oct 7, 2020
2 parents b4a4ea9 + c8f2383 commit 28c012f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
Binary file added body/body_yuu.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 mask/mask_yuu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
|![test](./sample/rei_pantie.png)|![test](./sample/mira_pantie.png)|
|[薄荷](https://booth.pm/ja/items/2215270)ちゃん|[メリノ](https://booth.pm/ja/items/2351859)|
|![test](./sample/hakka_pantie.png)|![test](./sample/merino_pantie.png)|
|[ユウ](https://booth.pm/ja/items/2417889)||
|![test](./sample/yuu_pantie.png)||

## スペシャルサンクス
[Booth:キッシュちゃん](https://mutachannel.booth.pm/items/954376)
Expand Down Expand Up @@ -194,6 +196,8 @@ When you want to know the help, please run `python patch.py -h`
|![test](./sample/rei_pantie.png)|![test](./sample/mira_pantie.png)|
|[Hakka](https://booth.pm/ja/items/2215270)|[Merino](https://booth.pm/ja/items/2351859)|
|![test](./sample/hakka_pantie.png)|![test](./sample/merino_pantie.png)|
|[Yuu](https://booth.pm/ja/items/2417889)||
|![test](./sample/yuu_pantie.png)||

## Special thanks
[Quiche model](https://mutachannel.booth.pm/items/954376)
Expand Down
Binary file added sample/yuu_pantie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions src/models/yuu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from PIL import Image, ImageOps
import numpy as np
import skimage.io as io
from src.models.class_patcher import patcher
from src.utils.imgproc import *
from skimage.color import rgb2hsv, hsv2rgb


class patcher(patcher):
def __init__(self, body='./body/body_yuu.png', **options):
super().__init__('ユウ', body=body, pantie_position=[634, 7], **options)
self.mask = io.imread('./mask/mask_yuu.png')

def convert(self, image):
pantie = np.array(image)
patch = np.copy(pantie[-170:-5, 546:, :])
[pr, pc, d] = patch.shape
pantie[115:115 + pr, :pc, :] = patch[::-1, ::-1]
arrx = np.zeros(25)
arry = np.zeros(25)
arry[5:20] = np.sin(np.linspace(0,np.pi,15))*75
pantie = affine_transform_by_arr(pantie, arrx, arry)
pantie = perspective_transform(pantie, np.array([[1,0,0],[-0.001,1,0],[-0.0002,0,1]]))[:,:550]
pantie = np.uint8(resize(pantie[:275], [1.,1.29])*255)[:,8:]
pantie = np.bitwise_and(pantie, self.mask)
pantie = np.concatenate((pantie[:,::-1], pantie), axis=1)
return Image.fromarray(pantie)

0 comments on commit 28c012f

Please sign in to comment.