1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C#でGraphicsのInterpolationModeはNearestNeighborが一番早い

1
Last updated at Posted at 2018-07-08

概要

C#の話です。
GraphicsでDrawImageするとき、元画像と描画先のサイズが違うと補完して出力されます。
この補完方法はGraphics.InterpolationModeで指定できます。
測定した結果、NearestNeighborが一番早かったです。

サンプルコード

以下に実際に動作するコードを置いてます。
https://github.com/minoru-nagasawa/PerformanceInterpolationMode/

結果

NearestNeighborが一番早く、他の30%ぐらいで描画されます。

補完方法 合計クロック数 比率
Default 24130822 100%
Low 24676698 102%
High 40063964 166%
Bilinear 24049502 100%
Bicubic 110087971 456%
NearestNeighbor 7526678 31%
HighQualityBilinear 38939439 161%
HighQualityBicubic 40209789 167%

image.png

補足

本当は、Sizeによっても分ける必要がありそうですが、一番早いのを知りたかったのでこれぐらいで。

参考

1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?