
Imagick::distortImage 함수는 이미지 왜곡을 위한 함수로, 첫 번째 인자로 사용되는 "distortion" 타입은 이미지 왜곡의 방식을 결정합니다.
"distortion" 이라는 단어는 정확히는 " 왜곡" 이라고 번역되며, 이미지의 모양을 변형시키는 것을 의미합니다.
Imagick::distortImage 함수에서 사용되는 "distortion" 타입의 목록은 다음과 같습니다.
- AFFINE:仿射변환(점, 선, 직선, 평면의 변형)
- CYLINDRICAL:원통변환(원통의 변형)
- PERSPECTIVE: перспектив변환(원근법의 변형)
- POLAR:극도변환(원형의 변형)
- SKEWX:X축 비대칭 변형
- SKEWY:Y축 비대칭 변형
- SHEAR:회전변환(회전변형)
Imagick::distortImage 함수에서 사용되는 "distortion" 타입을 설정하는 방법은 다음과 같습니다.
- AFFINE: $imagick->distortImage('AFFINE', $affineMatrix, $backgroundColor);
- CYLINDRICAL: $imagick->distortImage('CYLINDRICAL', $cylindricalMatrix, $backgroundColor);
- PERSPECTIVE: $imagick->distortImage('PERSPECTIVE', $perspectiveMatrix, $backgroundColor);
- POLAR: $imagick->distortImage('POLAR', $polarMatrix, $backgroundColor);
- SKEWX: $imagick->distortImage('SKEWX', $skewXMatrix, $backgroundColor);
- SKEWY: $imagick->distortImage('SKEWY', $skewYMatrix, $backgroundColor);
- SHEAR: $imagick->distortImage('SHEAR', $shearMatrix, $backgroundColor);
위의 예제에서 $affineMatrix, $cylindricalMatrix, $perspectiveMatrix, $polarMatrix, $skewXMatrix, $skewYMatrix, $shearMatrix는 각각의 변형 타입에 대한 매트릭스 값을 의미하며, $backgroundColor는 변형된 이미지의 배경 색상을 의미합니다.
2025-05-09 23:05