728x90
반응형
PIL.Image.alpha_composite(im, dest=(0, 0), source=(0, 0)) : Image 1에 대해서 Image 2로 알파 합성 진행
Parameters :
- im1 : 이 위에 합성할 이미지
- (optional) dest에서 왼쪽 상단 corner의 좌표
- (optional) src에서 왼쪽 상단 corner의 좌표
Return : Image Object
두 이미지 모두 RGBA 형태여야 하고 같은 사이즈 여야 함.
PIL.Image.blend(im1, im2, alpha) : 특정 값(알파 상수)를 사용해 두 input image를 적절히 보간하여 새 이미지 합성
Parameters :
- im1 : 첫 번째 이미지
- im2 : 두 번째 이미지(첫번째, 두번째 같은 mode로 열어야 하고, size도 같아야 함.
- alpha : 보간 알파 인자 (0 : 첫번째 image가 그대로 복사됨 / 1 : 두번째 image가 그대로 복사됨)
Return : Image Object
두 이미지 모두 RGBA 형태여야 하고 같은 사이즈 여야 함.
728x90
반응형
'머신러닝 > Computer Vision' 카테고리의 다른 글
[PIL] 이미지 축소, 확대(Image resize) (0) | 2022.01.24 |
---|---|
[PIL] convert RGBA Numpy to PIL Image (TypeError: Cannot handle this data type: (1, 1, 4), <f4) (0) | 2022.01.24 |
[PIL] Crop / Clip image by Polygon points. / PIL로 이미지 자르기 (0) | 2021.12.21 |
[OpenCV] Histogram, Normalize (0) | 2021.11.09 |
Tensor to image / numpy array to image / PIL image save (Save feature as image) (0) | 2021.10.29 |