Skip to content

Commit

Permalink
RearAlice Converter Ver. 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TenteEEEE committed Jul 16, 2020
1 parent f4500fc commit 3503a01
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
Binary file added body/body_rearalice.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_rearalice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
|![test](./sample/necomaid_pantie.png)|![test](./sample/reney_pantie.png)|
|[東狐千春](https://yueou.booth.pm/items/1814958)ちゃん|[ロポリこん](https://mido0021.booth.pm/items/1415037)ちゃん|
|![test](./sample/chiharu_pantie.png)|![test](./sample/lopolykon_pantie.png)|
|[マロン](https://booth.pm/ja/items/1105063)ちゃん||
|![test](./sample/marron_pantie.png)||
|[マロン](https://booth.pm/ja/items/1105063)ちゃん|[リアアリス](https://booth.pm/ja/items/2146588)ちゃん|
|![test](./sample/marron_pantie.png)|![test](./sample/rearalice_pantie.png)|

## スペシャルサンクス
[Booth:キッシュちゃん](https://mutachannel.booth.pm/items/954376)
Expand Down Expand Up @@ -184,6 +184,8 @@ When you want to know the help, please run `python patch.py -h`
|![test](./sample/necomaid_pantie.png)|![test](./sample/reney_pantie.png)|
|[Touko Chiharu](https://yueou.booth.pm/items/1814958)|[Lopolykon](https://mido0021.booth.pm/items/1415037)|
|![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)|

## Special thanks
[Quiche model](https://mutachannel.booth.pm/items/954376)
Expand Down
Binary file added sample/rearalice_pantie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions src/models/rearalice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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_rearalice.png', **options):
super().__init__('リアアリス', body=body, pantie_position=[2162, 2320], **options)
self.mask = io.imread('./mask/mask_rearalice.png')

def convert(self, image):
pantie = np.array(image)
patch = np.copy(pantie[-140:-5, 546:, :])
[pr, pc, d] = patch.shape
pantie[125:125 + pr, :pc, :] = patch[::-1, ::-1]

front = pantie[:250, :330]
arrx = (np.linspace(0, 1, 36)**0.5) * 45
arrx[:10] += np.cos(np.linspace(0, np.pi / 2, 10))**2 * 12
arrx -= 50
arry = np.zeros(36)
front = affine_transform_by_arr(front, arrx, arry)[:-50]
front = np.uint8(resize(front, [1.55, 1.57]) * 255)

back = pantie[:-15, 330:][:, ::-1]
back = np.pad(back, [(0, 200), (0, 0), (0, 0)], mode='constant')
arrx = (np.linspace(0, 1, 36)**1.5) * 270
arrx -= np.sin(np.linspace(0, np.pi, 36) - np.pi / 6) * 14
arrx -= 200
arry = np.zeros(36)
back = affine_transform_by_arr(back, arrx, arry)
back = np.rot90(back)[::-1]
arrx = np.zeros(25)
arry = np.linspace(0, 1, 25)**2 * 40
arry += np.sin(np.linspace(0, np.pi, 25)) * 110
arry -= 50
back = np.rot90(affine_transform_by_arr(back, arrx, arry))[50:]
back = np.uint8(resize(back, [1.55, 1.57]) * 255)

front = front[:-40]
back = back[60:]
fr, fc, d = front.shape
br, bc, d = back.shape
pantie = np.zeros((fr + br, fc, d), dtype=np.uint8)
pantie[:fr, :fc, :] = front
pantie[fr:, :bc, :] = back
pantie = pantie[:, 11:]
pantie = np.bitwise_and(pantie, self.mask)
pantie = np.concatenate((pantie[:, ::-1], pantie), axis=1)
return Image.fromarray(pantie)

0 comments on commit 3503a01

Please sign in to comment.