“Pemrosesan gambar Python” Kode Jawaban

Tambahkan pemrosesan gambar

PImage img;

void setup() {
  // Images must be in the "data" directory to load correctly
  img = loadImage("laDefense.jpg");
}

void draw() {
  image(img, 0, 0);
  image(img, 0, 0, width/2, height/2);
}
Confused Capuchin

Pemrosesan gambar Python

# The file format of the source file.
print(image.format) # Output: JPEG

# The pixel format used by the image. Typical values are "1", "L", "RGB", or "CMYK."
print(image.mode) # Output: RGB

# Image size, in pixels. The size is given as a 2-tuple (width, height).
print(image.size) # Output: (1920, 1280)

# Colour palette table, if any.
print(image.palette) # Output: None
Clean Code Software Solutions

Pemrosesan gambar Python

image = Image.open('demo_image.jpg')
new_image = image.resize((400, 400))
new_image.save('image_400.jpg')

print(image.size) # Output: (1920, 1280)
print(new_image.size) # Output: (400, 400)
Clean Code Software Solutions

Jawaban yang mirip dengan “Pemrosesan gambar Python”

Pertanyaan yang mirip dengan “Pemrosesan gambar Python”

Lebih banyak jawaban terkait untuk “Pemrosesan gambar Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya