Comments (5)
Click "Network" to see my suggested fix for this ("improve-canvas-size") and other issues.
from resize.
Hi Jason,
thank you for your reply. I switched to your branch to give it a try and I have to say you did amazing work, results are perfect. I can see only one problem. It seems that after resize there appears some kind of border when I use other filter than NearestNeighbor and save as JPG, why is it so and is it intent?
Saved as JPG:
When I save result image as PNG the resulting images are with some black parts:
from resize.
This isn't the appropriate place to suggest using fpresize instead (disclosure: I am the author), but GitHub doesn't have private messaging, and you have no contact info.
I don't know what the problem is with the PNG images. Looks like some sort of numeric overflow/underflow. I'll look into it when I get a chance.
The border around the JPEG images is there because nfnt/resize uses transparent virtual pixels. That's useful sometimes, but it's not good if you're going to write the image to a file format that does not support transparency.
Assuming the original image did not have any transparency, then stripping the alpha channel before writing the JPEG file is probably the best thing to do (i.e. set each pixel to have maximum opacity).
from resize.
The PNG corruption is caused by invalid combinations of color and transparency values. I fixed it in my copy of the project.
from resize.
Issue is fixed. I pulled in the fixes from Jason, thanks you!
FYI, the "black parts" issue was caused by the way Go's image packages handles accessing value outside the image boundaries. It returns constant zeros, also on the alpha channel, if the underlying image has one. I fixed it by replicating the first/last row/column values if accessing values outside the boundaries.
from resize.
Related Issues (20)
- Benchmark HOT 2
- Don't reverse alpha premultiplication, it's fundamentally wrong HOT 6
- Resized image lost all metadata HOT 1
- 1px black border after resize png images HOT 2
- debian control file have hardcoded version. HOT 1
- Transparent images cause black coloring HOT 1
- panic: index out of range when resize some picture HOT 4
- ycc.go:126: undefined: image.YCbCrSubsampleRatio440 HOT 1
- Panic on Resize HOT 6
- Please version this repository HOT 1
- Increased file size after resizing (downscaling) HOT 4
- image not show on mobile browser after resizing HOT 1
- Panic on resize 2 HOT 2
- Detecting file format HOT 3
- Resizing animated gif HOT 1
- I'm no longer updating this package. HOT 6
- Error output is generated
- png image format is not recognized HOT 1
- High memory usage when processing many high-resolution images
- can you supper tiff
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 resize.