Comments (4)
Hermite_class does not use DOM, it should work.
Try using HERMITE.resample_single(canvas, 1024, 1024);
from hermite-resize.
Hi @viliusle, I tried HERMITE.resample_single(canvas, 1024, 1024);
on a PNG file of size 1437x1437. It is now resizing the image, however there are two issues:
- The resized image is 770x770 instead of 1024x1024
- The image is not cropped at all. In other words, the size of the canvas is still 1437x1437. The reduced image is simply sitting in the top-left corner of this canvas.
from hermite-resize.
HERMITE.resample_single(canvas, 1024, 1024, true) will resize canvas, it is off by default (will change it to on by default.)
Also your canvas is probably translated (ctx.translate), so it resized to 770, not 1024. Does it has white area?
p.s. this function does not resize visible area, it resize all canvas.
from hermite-resize.
Aha, did not know about the resize flag, I will try it out. Will also check if the canvas was translated in the image that I tried this with. The react-avatar-editor does allow translation, so that could be the issue. Thanks for all your help!
from hermite-resize.
Related Issues (13)
- Image mangled when down sampling too much HOT 3
- IndexSizeError when resizing from Blob HOT 2
- Image scaling with Hermite for pixel values above 255?
- Blank canvas with html2canvas HOT 1
- How to select multiple areas and crop ? HOT 1
- NPM HOT 2
- IE10 support HOT 2
- Incorrect resampling with multiple cores HOT 9
- Scaling down image quality HOT 3
- Uncaught TypeError: on_finish is not a function HOT 2
- Change package name to lowercase HOT 2
- How do I contribute? 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 hermite-resize.