Comments (1)
the documentation leads me to believe that it composes multiple transforms but only one "output" stream at the end. Is that correct?
That's correct. The ProcessingPipeline
model was built around a few specific low-level interop scenarios, and it would need more work to completely support what you're looking for. I have a couple of sample gists I've written up for other issues you might find helpful for seeing how it's used:
- Resizing with MagicScaler into a System.Drawing bitmap, then adding a watermark
- Resizing with MagicScaler using SkiaSharp for codec support on Linux
It would be possible, using the same basic pattern in those gists, to write the output of your first resize into a memory buffer and then use that buffer as a source to do a null transform and save for your first image, then re-use that same buffer as a source for your second and third resizes.
would any of it actually result in a more efficient (memory, compute) than our current approach of orchestrating the streams and multiple calls to Process?
Probably not, actually. At least not enough to justify the added complexity. Using that technique would disable the planar (YCbCr) processing ProcessImage
does with a JPEG source, making more work for both the pipeline and the output codec. And it would use more memory since the entire 1200px output would be in memory, which the pipeline normally avoids.
I have a longer-term vision for extending the pipeline model to support forking/merging for more advanced processing. I'll keep this use case in mind when I get around to designing and building that out.
This library runs circles around the nightmare that was our old GDI approach.
I can imagine, with that many images of that size π . It's always interesting to hear what kind of volume people are throwing at this thing. Glad to know it's working out.
from photosauce.
Related Issues (20)
- AVIF Encoder HOT 4
- This is awesome β€where is the Donate button? HOT 1
- GIF animations with mixed disposal methods not handled correctly HOT 2
- Orientation is not rotating properly HOT 1
- System.Runtime.InteropServices.COMException at PhotoSauce.MagicScaler.WicPlanarCache.loadBuffer
- Problem with certain PNG images HOT 8
- Transparent Color on PadTransform HOT 1
- RobiniaDocs API Explorer
- Update libwebp HOT 4
- Option to retain gif loop count when resizing HOT 6
- Could not load type 'PhotoSauce.MagicScaler.Converters.ChannelChanger`1' HOT 8
- ColorMatrixTransform does not unpremultiply/premultiply HOT 1
- Default JPEG encoding options are not publicly accessible HOT 4
- EncoderInfo not set correctly if output to Stream
- MagicScalar Linux issue
- libpng throws bad adaptive filter will abort writing result HOT 3
- libpng fails to convert several files that WIC can handle HOT 2
- `ArgumentOutOfRangeException` reading JPEG XL image from their test page HOT 3
- After update the solution to .NET 8 version the NativeCodecs dependency started to fail HOT 3
- Noob question: Having a hard time understanding the native codec binary build steps.
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 photosauce.