jwagner / jwagner/smartcrop-cli

Cropped images are sometimes 1 pixel too small

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
329
Forks
38
PR merge metrics
No merged PRs in 30d

Description

`smartcrop --width 100 --height 400 %1 %~n1_out%~x1`

When I run this command on kitty.jpg from the test suite, the output image is 99x400.

![2023-03-19_22-47-36_dopus_crop](https://user-images.githubusercontent.com/8092905/226242059-157630f4-086c-43a0-bcc0-2e4a57171f10.png)

I assume this happens because of the skewed aspect ratio of the requested crop, I've encountered a similar "missing pixel" problem when cropping in Photoshop. Is there a way to force exact dimensions for the output?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reported smartcrop command against kitty.jpg from the test suite and trace how requested crop dimensions become the output size. Confirm the behavior for 100x400 crops and add coverage showing that the resulting image has exactly the requested dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.