Skip to content

output result as IPixelSource #175

Answered by saucecontrol
vpenades asked this question in Q&A
Discussion options

You must be logged in to vote

The result of an open pipeline is already available as ProcessingPipeline.PixelSource

Sounds like you want something like this:

var settings = new ProcessImageSettings {
	Width = 1024,
	// The default profile mode may convert to other well-known color spaces,
	// but there is currently no way to retrieve the profile. Normalizing to
	// sRGB ensures the color space is known.
	ColorProfileMode = ColorProfileMode.ConvertToSrgb
};

// create an open pipeline
using var pipeline = MagicImageProcessor.BuildPipeline("/path/to/input", settings);

// normalize the pixel format to match destination
pipeline.AddTransform(new FormatConversionTransform(PixelFormats.Bgr24bpp));

// copy the output anywh…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vpenades
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #174 on January 10, 2025 20:05.