Reputation: 4845
I have a piece of code that create a heatmap, and everything is saved into a bitmap image. My main method is below.
HeatMap map = new HeatMap(colors, width, height, file, U, V);
_maps.Clear();
_maps.Add(map);
Bitmap newBMP = overlayBitmap(map.Image, width * 3, height * 3, times, dates, colors); // resizes the bmp without blending colors
if (save) {
newBMP.Save(file, ImageFormat.Png);
}
HeatMap()
is a method that takes in those parameters, creates a bitmap
, and stores it into an instance.
overlayBitmap()
is a method that takes my previously made map, through some InterpolationMode.NearestNeighbor
enlarges the images, and puts text onto this heatmap graph, like x/y-axis labels and title.
Then I use a simple save
method.
My question is - what is the best way to save the bmp
into the highest quality possible? I opted for .png
instead of .jpeg
, but are there additional things I can do?
Upvotes: 0
Views: 506
Reputation: 31
.png is the optimal way of storing a bmp without loosing quality, it is more effective then just zipping a bmp. And not a single pixel is lost.
Upvotes: 1