Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop offset with or without bbox argument #1

Conversation

radarhere
Copy link

For python-pillow#3950

Correct me if I'm wrong - if you're going to crop the offset from the image, then it would seem that you should crop it whether or not there is a bbox argument given by the user.

@nulano
Copy link
Owner

nulano commented Jul 10, 2019

The offset is just used to adjust the bbox coordinates; it is equal to the (Windows) screen coordinates of the top-left pixel, which may be negative. It is not used to crop the image by itself.

The correct bbox for the whole screen is therefore (x0, y0, x0 + width, y0 + height), which gets adjusted to (0, 0, width, height), i.e. the whole image.

Perhaps this confusion is caused by the name offset? If so, can you suggest a better name?

@radarhere
Copy link
Author

Thanks for your explanation

@radarhere radarhere closed this Jul 11, 2019
@radarhere radarhere deleted the imagegrab_multimonitor branch July 11, 2019 08:55
nulano pushed a commit that referenced this pull request Dec 9, 2019
nulano pushed a commit that referenced this pull request Dec 29, 2019
nulano pushed a commit that referenced this pull request Jan 1, 2020
Corrected short and long range checks
nulano pushed a commit that referenced this pull request May 9, 2020
Changed default offset for Exif
nulano pushed a commit that referenced this pull request Jun 23, 2020
nulano pushed a commit that referenced this pull request Jul 9, 2020
Updated documentation; Simplified code
nulano pushed a commit that referenced this pull request Aug 31, 2020
nulano pushed a commit that referenced this pull request Oct 11, 2020
nulano pushed a commit that referenced this pull request Oct 13, 2020
nulano pushed a commit that referenced this pull request Dec 30, 2020
radarhere pushed a commit that referenced this pull request Feb 22, 2021
Fixed unexpected indentation
nulano pushed a commit that referenced this pull request Mar 30, 2021
nulano pushed a commit that referenced this pull request Aug 2, 2021
Save in ICNS format to support all operating systems
nulano pushed a commit that referenced this pull request Aug 2, 2021
Removed duplicate block
nulano pushed a commit that referenced this pull request Aug 2, 2021
nulano pushed a commit that referenced this pull request Aug 2, 2021
Added test and flush file pointer
nulano pushed a commit that referenced this pull request Jan 31, 2022
Improved batch processing example in tutorial
nulano pushed a commit that referenced this pull request Apr 16, 2022
nulano pushed a commit that referenced this pull request May 24, 2022
CI: Add a Cygwin run to GitHub Actions

There are still a few things that are weird, but this looks much better than what I have now.
nulano pushed a commit that referenced this pull request May 24, 2022
nulano pushed a commit that referenced this pull request May 24, 2022
* Removed unused import

* Restored existing checks

* Restored coerce_e, _E and data property

* Deprecated coerce_e

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
nulano pushed a commit that referenced this pull request May 24, 2022
nulano pushed a commit that referenced this pull request Jun 19, 2022
radarhere pushed a commit that referenced this pull request Jun 30, 2022
nulano pushed a commit that referenced this pull request Aug 2, 2022
nulano pushed a commit that referenced this pull request Aug 2, 2022
radarhere pushed a commit that referenced this pull request Sep 21, 2022
…in-finding-new-size

Round position in pad()
nulano pushed a commit that referenced this pull request Oct 2, 2022
Improved palette handling in ImageOps
radarhere pushed a commit that referenced this pull request Oct 11, 2022
nulano pushed a commit that referenced this pull request Dec 31, 2022
nulano pushed a commit that referenced this pull request Dec 31, 2022
nulano pushed a commit that referenced this pull request Jan 9, 2023
Use break instead of goto
nulano pushed a commit that referenced this pull request Feb 12, 2023
nulano pushed a commit that referenced this pull request Mar 5, 2023
nulano pushed a commit that referenced this pull request Jun 24, 2023
Call init() if mimetype is not found with preinit()
nulano pushed a commit that referenced this pull request Jun 24, 2023
Only assert image is similar
nulano pushed a commit that referenced this pull request Aug 6, 2023
nulano pushed a commit that referenced this pull request Oct 9, 2023
Added custom before_install to temporarily pin wheel to 0.31.1
nulano pushed a commit that referenced this pull request Oct 9, 2023
_decoder.get_next() may return None
nulano pushed a commit that referenced this pull request Oct 9, 2023
Last trailer comment has priority
nulano pushed a commit that referenced this pull request Nov 25, 2023
Do not assign new fp attribute to image when closing
nulano pushed a commit that referenced this pull request Nov 27, 2023
nulano pushed a commit that referenced this pull request Dec 12, 2023
radarhere pushed a commit that referenced this pull request Feb 15, 2024
radarhere pushed a commit that referenced this pull request Mar 2, 2024
Test error is raised without LOAD_TRUNCATED_IMAGES
nulano pushed a commit that referenced this pull request Apr 29, 2024
radarhere pushed a commit that referenced this pull request May 30, 2024
nulano pushed a commit that referenced this pull request Jul 2, 2024
nulano pushed a commit that referenced this pull request Aug 25, 2024
Do not import numpy.typing unless TYPE_CHECKING
nulano pushed a commit that referenced this pull request Aug 25, 2024
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
nulano pushed a commit that referenced this pull request Sep 22, 2024
Renamed variable for first part of splitext to root
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.

2 participants