본문 바로가기
728x90
반응형

Image Processing/Project3

[Image Processing] 1. Python으로 Dither 만들기: Floyd Steinberg Dithering 1. Python으로 Dither 만들기: Floyd Steinberg Dithering 지난 글에 Bit Depth를 줄이는 방법으로 Truncation과 Round 두 가지 방법을 확인했다. 이번에는 실제로 Dither를 만들어 볼 것이다. Floyd Steinberg Dithering 알고리즘을 구현할 것이다. https://rimeestore.tistory.com/entry/Error-Diffusion%EC%9D%B4%EB%9E%80 Error Diffusion이란? Dithering Dithering이란 Bit Depth가 높은 영상데이터를 Bit Depth가 낮은 영상데이터로 바꿀 때 적용하는 알고리즘 중 하나이다. 예를 들어, 12 Bit 영상데이터는 RGB 각각 0 ~ 4095까지 총 40.. 2023. 11. 15.
[Image Processing] 1. Python으로 Dither 만들기: Truncation, Round 1. Python으로 Dither 만들기: Truncation, Round 6Bit Dither 만들기 파이썬으로 디더(Dither)를 만들어볼 예정이다. Dither는 시간적 디더링과 공간적 디더링이 있는데, 둘 중 공간적 디더를 만들어 볼 것이다. 공간적 디더링에 관한 자세한 내용은 아래 링크로 가면 자세히 알 수 있다. https://rimeestore.tistory.com/entry/Error-Diffusion%EC%9D%B4%EB%9E%80 Error Diffusion이란? Dithering Dithering이란 Bit Depth가 높은 영상데이터를 Bit Depth가 낮은 영상데이터로 바꿀 때 적용하는 알고리즘 중 하나이다. 예를 들어, 12 Bit 영상데이터는 RGB 각각 0 ~ 4095까지.. 2023. 11. 13.
파이썬에서 RGB 이미지를 Grayscale 이미지로 바꾸기 라이브러리를 사용하지 않고 직접 알고리즘을 구현해보는 것이 중요하다. from PIL import Image import numpy as np 알고리즘 구현에 사용할 라이브러리는 PIL과 numpy이다. #Option IMG_FILE = "Girl_with_a_Pearl_Earring.jpg" # Only Use JPG File SHOW_IMAGE = True 옵션으로 IMG_FILE과 SHOW_IMAGE를 파라미터로 사용한다. ※ 이번 알고리즘에 사용할 이미지는 확장자가 jpg이다. png는 채널이 4개이기 때문에 이번 코드에서는 사용할 수 없다. 4번째 채널은 RGB값이 아니고 알파채널을 의미하는데, 이 값은 단순평균을 낼 때 사용할 수 없다. img = Image.open(IMG_FILE) # Im.. 2022. 9. 2.
728x90
반응형