Analyze and modify pixels of an image #184
Unanswered
patrickulrich007
asked this question in
Q&A
Replies: 2 comments 1 reply
-
PhotoSauce.MagicScaler isn't a general purpose imaging library. It isn't the right tool to use for this. You should look at ImageSharp https://github.com/SixLabors/ImageSharp , it will likely be appropriate for your needs. |
Beta Was this translation helpful? Give feedback.
0 replies
-
What a shame, I tried ImageSharp for same use case, with only reading pixels and it is so much slower then PhotoSauce. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I'm looking for a replacement of the System.Drawing.Bitmap class, as we want to move to Linux.
I'm looking into the PhotoSauce library and so far it looks very promising.
One of my use cases is, to open an image(Jpg, Tiff, Png, ...) and analyze the image, for example look for all read pixels and replace them with a white pixel.
So far, I was able to open the image iterate over the pixels and check the color.
But now, I'm not able to save the modified byte[] back as a Jpg. Can anybody give me some hints?
This is my code so far:
int redPixels = 0;
long totalPixels = 0;
using (var imgStream = new FileStream(_SourceFileName, FileMode.Open, FileAccess.ReadWrite))
{
var settings = new ProcessImageSettings();
var pipeline = MagicImageProcessor.BuildPipeline(imgStream, settings);
}
My idea is, to modify the pixel in the if, where I count the red pixels. But then, how can I save that byte[] as an image?
I feel like this is a stupid question, but I spend already some time and now I try here in the forum.
Thx and greetings
Beta Was this translation helpful? Give feedback.
All reactions