SebastianR#32282
Hello,
to process a large image I need to use a pipeline. The Dpi can only be set for a bitmap or an imagegenerator.
I came up with the following so far:
The use of an imagegenerator also implies the use of a backgroundcolor, which I have to get from the readers bitmap again (because of
I wonder wether there is a easier way to assign Dpi. 🤔
to process a large image I need to use a pipeline. The Dpi can only be set for a bitmap or an imagegenerator.
I came up with the following so far:
using (var reader = ImageReader.Create(@"..\largeinput.tif")
using (var generator = new ImageGenerator(reader, RgbColor.White)
using (var combiner = new Combiner(CombineMode.AlphaOverlay, reader))
using (var writer = new TiffWriter(@"..\output.tif");)
{
generator.DpiX = 123;
generator.DpiY = 123;
Pipeline.Run(generator + combiner + writer);
}The use of an imagegenerator also implies the use of a backgroundcolor, which I have to get from the readers bitmap again (because of
bitmap.ColorManagement.BackgroundColor; beeing the only source of a background color).I wonder wether there is a easier way to assign Dpi. 🤔