Comments (2)
Thanks @mhulse for your very helpful explanation, this was indeed not obvious at all, and this is the only place where I found some clarification.
However it's still not completely clear: does that mean that the width
and height
from the options are only there to provide an aspect ratio of the desired crop? Multiplying or dividing them does not seem to affect the result at all.
From experimenting it seems that the minScale
and maxScale
options, when they have their 1.0
default value, make the crop result always have either 100% of the width or 100% of the height of the original image.
Lowering them allows smartcrop to also try to return potentially smaller crop sizes.
from smartcrop.js.
Based on your input image size, and desired crop area, the resulting relative crop area is (width) and (height) at coordinates (x) and (y). You must crop your image using smartcrop's output width, height, x, y, and then scale up or down to your desired width and height (using tool of choice, like ImageMagick or GraphicsMagick).
This is correct. It seemed obvious to me but I guess it's not. I'll try to add some clarification in the next release. Thanks for sharing this.
from smartcrop.js.
Related Issues (20)
- Smartcrop removing JPEG metadata HOT 2
- Ft Request - Object-Position: var% var%; HOT 1
- [Feature Request] Typescript declaration file HOT 2
- Option for multiple base skin colours HOT 2
- Cropped image dimensions by 30% is like 5% less size on memory HOT 6
- Ability to remove background behind detected object HOT 1
- Type Definition Error HOT 3
- Test blazeface face detector
- Type Definition Error HOT 1
- Smartcrop for Swift HOT 2
- Import api-face HOT 1
- How to use for iOS? HOT 1
- Add CDN Example HOT 2
- is it possible to input raw data & get raw data as output? HOT 1
- Example using faceapi with smartcrop-sharp on nodejs? HOT 2
- Consider using face-api fork
- consider using defocus detection algorithm
- Cropped images are sometimes 1 pixel too small HOT 3
- Is width/height ratio respected for cropping? HOT 1
- Error during pip install HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartcrop.js.