Comments (4)
did you set imageQuality
to 100? The default is set to 90
from ngx-image-cropper.
Now I have, still no luck.
Is there some kind of image smoothing algorithm? Can I disable it?
from ngx-image-cropper.
That's a interesting question, because I have noticed when I upload a image to the cropper, it actually increases significantly the image size, I was running some tests with a image that has 3.5MB, and the output after using the image cropper was a image with 9MB!
Is this behavior intentional? It makes me wonder why it almost triplicated the file size, kinda looks like it does have endeed some algorithm applied to the image when it's emitted 🤔
*Edit:
It seems that, using [imageQuality] and set the value to around 90, and set the [format] to "jpeg" (I was using "png"), you can control the image quality and try to balance between size and quality, now the image with 3.5MB outputs to less than 1MB 😳
I think it's all about the png format, by definition, png images are heavier than jpeg ones, so if anyone is facing this problem, consider tweaking these settings.
from ngx-image-cropper.
Seems like there is an option for that on the HTML canvas: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
Feel free to add it as an option.
The reason the size increases is because the HTML canvas outputs a base64 string which is no compressed. It contains the data for each pixel. Using jpeg helps a lot with the file size. Using blob as output might help as well.
from ngx-image-cropper.
Related Issues (20)
- Not displaying IONIC angular HOT 1
- How to replay the cropping process on an array of images? HOT 4
- HammerJs and Change Detection HOT 1
- How to disable this warn: Could not find HammerJS - Pinch Gesture won't work
- Usage of `data:` regarding Content Security Policy (CSP) HOT 1
- Feature request - please help HOT 1
- Transparent background is converted to Black when using jpeg format HOT 1
- Feature Request: Pinch Zoom image HOT 2
- move image into zone crop HOT 1
- Give radius for round cropper HOT 1
- Exclusively support Angular 17 ? HOT 1
- Error on Angular 17+ HOT 2
- Upgrade to 8.0.0 HOT 4
- Angular 18 Support HOT 1
- Pass more error details to the `loadImageFailed` method
- Cropper Position is not working HOT 1
- ImageCroppedEvent has set blob to null HOT 2
- Error: Failed to get Blob for transformed image. HOT 1
- Fixed canvas size HOT 4
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 ngx-image-cropper.