Skip to content

FEAT: Add three image converters (color saturation, resize, rotate)#1633

Merged
romanlutz merged 7 commits intomicrosoft:mainfrom
fdubut:image_converters
Apr 22, 2026
Merged

FEAT: Add three image converters (color saturation, resize, rotate)#1633
romanlutz merged 7 commits intomicrosoft:mainfrom
fdubut:image_converters

Conversation

@fdubut
Copy link
Copy Markdown
Contributor

@fdubut fdubut commented Apr 17, 2026

Description

Add three image converters to adjust color saturation, resize and rotate images. All three converters call PIL, and the code structure follows the existing image compression converter.

Tests and Documentation

Added one test per converter, and updated both the root converter doc and the image converter doc.

Copy link
Copy Markdown
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool!

Comment thread pyrit/prompt_converter/image_color_saturation_converter.py Outdated
Comment thread pyrit/prompt_converter/image_color_saturation_converter.py Outdated
Comment thread pyrit/prompt_converter/image_rotation_converter.py Outdated
Extract common image I/O logic (URL download, format resolution, JPEG
transparency handling, serialization) into BaseImageToImageConverter ABC.
Each converter now only implements _apply_transform with its PIL operation.

Addresses PR review comments:
- Eliminates duplicated _read_image_from_url across all three converters
- Eliminates duplicated convert_async boilerplate
- Simplifies format_extensions dict to output_format.lower()
- Centralizes JPEG transparency handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread doc/code/converters/0_converters.py Outdated
romanlutz and others added 2 commits April 22, 2026 07:00
The kernelspec block with display_name was added by the PR but
wasn't present on main. Remove it to avoid pipeline issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@jbolor21 jbolor21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great to me!

@romanlutz romanlutz merged commit 2c38d46 into microsoft:main Apr 22, 2026
39 checks passed
@fdubut fdubut deleted the image_converters branch April 22, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants