convert bitonal TIFF to bitonal PNG in C#

前端 未结 5 1741
天涯浪人
天涯浪人 2021-01-12 10:00

I need to convert bitonal (black and white) TIFF files into another format for display by a web browser, currently we\'re using JPGs, but the format isn\'t crucial. From rea

5条回答
  •  孤独总比滥情好
    2021-01-12 10:43

    This is an old thread. However, I'll add my 2 cents.

    I use AForge.Net libraries (open source)

    use these dlls. Aforge.dll, AForge.Imaging.dll

    using AForge.Imaging.Filters;
    
    private void ConvertBitmap()
    {
        markedBitmap = Grayscale.CommonAlgorithms.RMY.Apply(markedBitmap);
        ApplyFilter(new FloydSteinbergDithering());
    }
    private void ApplyFilter(IFilter filter)
    {
        // apply filter
        convertedBitmap = filter.Apply(markedBitmap);
    }
    

提交回复
热议问题