Skip to content

Commit

Permalink
Mira pantie converter Ver. 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TenteEEEE committed Jul 18, 2020
1 parent 9bdf2a2 commit 1572a9b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
Binary file added body/body_mira.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_mira.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
|![test](./sample/chiharu_pantie.png)|![test](./sample/lopolykon_pantie.png)|
|[マロン](https://booth.pm/ja/items/1105063)ちゃん|[リアアリス](https://booth.pm/ja/items/2146588)ちゃん|
|![test](./sample/marron_pantie.png)|![test](./sample/rearalice_pantie.png)|
|[式神(零)](https://booth.pm/ja/items/2033949)||
|![test](./sample/rei_pantie.png)||
|[式神(零)](https://booth.pm/ja/items/2033949)|[ミラ](https://booth.pm/ja/items/2140459)|
|![test](./sample/rei_pantie.png)|![test](./sample/mira_pantie.png)|

## スペシャルサンクス
[Booth:キッシュちゃん](https://mutachannel.booth.pm/items/954376)
Expand Down Expand Up @@ -188,8 +188,8 @@ When you want to know the help, please run `python patch.py -h`
|![test](./sample/chiharu_pantie.png)|![test](./sample/lopolykon_pantie.png)|
|[Marron](https://booth.pm/ja/items/1105063)|[RearAlice](https://booth.pm/ja/items/2146588)|
|![test](./sample/marron_pantie.png)|![test](./sample/rearalice_pantie.png)|
|[Rei](https://booth.pm/ja/items/2033949)||
|![test](./sample/rei_pantie.png)||
|[Rei](https://booth.pm/ja/items/2033949)|[Mira](https://booth.pm/ja/items/2140459)|
|![test](./sample/rei_pantie.png)|![test](./sample/mira_pantie.png)|

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


class patcher(patcher):
def __init__(self, body='./body/body_mira.png', **options):
super().__init__('ミラ', body=body, pantie_position=[1268, 10], **options)
self.mask = io.imread('./mask/mask_mira.png')

def convert(self, image):
pantie = np.array(image)
arrx = np.zeros(25)
arry = np.zeros(25)
arry[:10] -= np.sin(np.linspace(0, 1, 10)) * 30
pantie_ = affine_transform_by_arr(pantie, arrx, arry)

patch = np.copy(pantie[-190:, 546:, :])
pantie[-100:, 546:, :] = 0
patch = skt.resize(patch[::-1, ::-1, :], (patch.shape[0] + 25, patch.shape[1]), anti_aliasing=True, mode='reflect')
[pr, pc, d] = patch.shape
pantie_[125:125 + pr, :pc, :] = patch
io.imshow(pantie_[:340])
pantie = pantie_[:340]
pantie = np.uint8(resize(pantie, [0.9, 1.25]) * 255)
io.imsave('test.png', pantie)
pantie = np.bitwise_and(pantie, self.mask)
return Image.fromarray(pantie)

0 comments on commit 1572a9b

Please sign in to comment.