Search

Atalasoft Knowledge Base

FAQ: What Pixel Formats are Supported for ResampleCommand by ResampleMethod

Tananda
DotImage

The question has come up as to the ResampleCommand.

Our documentation for the ResampleMethod enum warns when a given method will not support "upsampling" (making an image larger) or "downsampling" (making an image smaller), but does not make any mention of whether any given ResampleMethod supports any given PixelFormat

 Unfortunately, the IsPixelFormatSupported method

bool ResampleCommand.IsPixelFormatSupported(PixelFormat format)

always returns true .. regardless of the settings of the DestSize and Method.

There is no official documentation for this, we (support) wrote a small test harness to answer this question. The test app will be included in this case for those who are curious as to our methods...

Results

The ResampleCommand will work under ALL ResampleMedhod settings for the following PixelFormat values:

  • Pixel8bppGrayscale
  • Pixel24bppBgr
  • Pixel32bppBgr
  • Pixel1bppIndexed
  • Pixel4bppIndexed (note: output will be Pixel8bppIndexed)
  • Pixel8bppIndexed
  • Pixel16bppGrayscaleAlpha
  • Pixel32bppBgra
  • Pixel32bppCmyk

The ResampleCommand will work with SOME ResampleMethod settings for the following 3 PixelFormat values

Pixel16bppGrayscale
Pixel48bppBgr
Pixel64bppBgra

Supported

  • NearestNeighbor
  • BiLinear
  • BiCubic
  • AreaAverage

UNSUPPORTED

  • BoxFilter
  • TriangleFilter
  • HammingFilter
  • GaussianFilter
  • BellFilter
  • BsplineFilter
  • Cubic1Filter
  • Cubic2Filter
  • LanczosFilter
  • MitchellFilter
  • SincFilter
  • HermiteFilter
  • HanningFilter
  • CatromFilter
Details
Last Modified: 2 days ago @ 11:00 AM
Last Modified By: Tananda
Type: FAQ
Article not rated yet.
Article has been viewed 9 times.
Options
Also In This Category