def ZNRFB(img_input, coldepth, scaling):
if coldepth != 24:
img_input = img_input.convert("RGB")
# Memanggil fungsi ImgNegative untuk membuat efek negatif
neg_img = ImgNegative(img_input, coldepth)
# Memanggil fungsi ZoomIn pada gambar negatif
zoomed_img = ZoomIn(neg_img, coldepth, scaling)
# Membuat img_output
img_output = Image.new("RGB", zoomed_img.size)
pixels = img_output.load()
half_height = int(zoomed_img.size[1] / 2)
# Membagi dua secara horizontal dan memberikan efek negatif pada bagian atas
for i in range(zoomed_img.size[0]):
for j in range(zoomed_img.size[1]):
if j < half_height:
r_neg, g_neg, b_neg = zoomed_img.getpixel(
(i, j)
) # Pastikan ini adalah tuple
pixels[i, j] = (r_neg, g_neg, b_neg)
else:
r, g, b = zoomed_img.getpixel((i, j)) # Pastikan ini adalah tuple
pixels[i, j] = (r, g, b)
img_neg = img_output
# Memanggil fungsi ImgRotate untuk memutar 90 derajat
rotated_img = ImgRotate(img_neg, coldepth, 90, "C")
# Memanggil fungsi ImgFlip untuk flip secara vertikal
flipped_img = ImgFlip(rotated_img, coldepth, "vertical")
# Menggabungkan hasil menggunakan blending
blended_img = blending(img_neg, coldepth, flipped_img, coldepth, 0.5, 0.5)
return blended_img
error An error occurred: cannot unpack non-iterable int object
New contributor
user25110697 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.