Comments (5)
Size could be given in percentage or pixels, the transform may be proportional or not
{width:'100%'}
{height:'100'} // means the height will be 100 pixels and it is a proportional transform
{width:'120%', height:100} : non proportional transform. The width will have 120% of the current size and the height, 100 pixels
from image-js.
from image-js.
- Shrinking
- sampling (discard rows / columns)
- average ?
- ...
- Enlarge
- interpolation
- ...
from image-js.
For sampling I think this should be the way to select:
An example
1 1 0 0 1
5 pts -> 2 pts
To calculate increment we remove one to the original size
increment : (5 - 1) / 2 = 2
First value -> increment / 2 = 1
Next value -> 1 + 2 = 3
Result : 1 0
5 pts -> 3 pts
increment : (5 - 1) / 3 = 1.33
First value -> increment / 2 = 0.66
Point 0 : 0.66 -> Math.round -> 1
Point 1 : 0.66 + 1.33 = 2
Point 2 : 0.66 + 2 * 1.33 = 3.33 -> Math.round -> 3
Result : 1 0 0
I have updated the code at:
http://codeshare.io/vKLaq
from image-js.
This is interesting:
Subsampling.pdf
from image-js.
Related Issues (20)
- is there a way to draw a circle on an image? HOT 1
- Buffer.from web browser HOT 1
- Add to cdnjs
- setMatrix(): Return this object HOT 1
- jpeg encoding in the browser does not work HOT 2
- gaussian & transparency issue
- Which is the fastest way to show an image? HOT 2
- Is there a way to add ICC profile to the generated image? HOT 2
- Cloudflare Workers - toBuffer with jpeg fails due to reliance on jpeg-js HOT 2
- Is there a way to scale a png like gdal scale with src min/max destination min/max? HOT 3
- Type for Image.meta
- Allow usage of higher resolution images
- toBase64 doesn't work well with type webp and iOS
- "Interlace method 1 not supported" Error in browser(Firefox) HOT 1
- Does the library support a sepia filter? HOT 1
- Add function of Harris corner detection and FAST corner detection HOT 3
- TypeScript for grey() GreyAlgorithm not failure HOT 2
- Can I use with alpha image? HOT 2
- Overloaded type for `Image.getRGBAData()`
- I want to add image processing functions, which is not there in the Image-js library. 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 image-js.