Convert color images to grayscale
You need to convert color images to grayscale for analysis, preprocessing, or model inputs that require single-channel images.
You need to resize, rotate, crop, or convert hundreds of images—and keep track of all the transformed versions.
Images · Notebook · Updated
Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.
You apply PIL transformations (resize, rotate, flip, crop) to images in your table using Pixeltable's built-in image functions—common operations that work directly on image columns.
You can iterate on transformations before adding them to your table. Use .select() with .collect() to preview results on sample images—nothing is stored in your table. If you want to collect only the first few rows, use .head(n) instead of .collect(). Once you're satisfied, use .add_computed_column() to apply the transformation to all images in your table.
pip install pixeltable
pxt.create_table()insert()add_computed_column()# Save as computed columnst.add_computed_column(height=t.image.height)t.add_computed_column(width=t.image.width)t.add_computed_column(mode=t.image.mode) # RGB, RGBA, L (grayscale), etc.
One cell of the notebook, copied as it is. Open it in Colab for the rest.
You need to convert color images to grayscale for analysis, preprocessing, or model inputs that require single-channel images.
Run YOLOX object detection in Python on images and video frames, then query and draw the detected objects.
Automatically identify and locate objects in images using YOLOX object detection models.
Understand when to use bounding boxes versus pixel-level masks for image analysis.