Converting Multipage TIFF to PNG #2377
-
Hello, I am new to using ImageSharp. I am trying to convert a stream that has TIFF data and convert each frame into a PNG. Is there a next frame or something like that or some way to iterate through or select the current frame? Currently, this is what I have for converting a local TIFF into PNGs. Currently, only the first image/frame is saved but there may be multiple frames. using (Image image = Image.Load("test.tif"))
{
Console.WriteLine($"{image}");
Console.WriteLine($"image frames: {image.Frames}");
Console.WriteLine($"image frames count: {image.Frames.Count}");
for (int i = 0; i < image.Frames.Count; i++)
{
Console.WriteLine($"{image.Frames[i]}");
image.SaveAsPng($"test{i}.png");
}
} When I switch to using streams, I assume I would use the same way of loading (since
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
PDF (Portable Document Format) is not an image format. As such it is not supported by the library. You would need a PDF library that can import images. |
Beta Was this translation helpful? Give feedback.
PDF (Portable Document Format) is not an image format. As such it is not supported by the library. You would need a PDF library that can import images.