-1

Are there any good libraries for Python that can do various image processing functions like White Balance, Histogram Equalization, etc, with 16 bit raw image files?

I've searched for something like that for a while but couldn't come up with anything...

TheTomer
  • 143
  • 3
  • 11
  • 16 bits is not mainstream. –  May 04 '21 at 18:19
  • 1
    Do you mean raw as in raw pixel data with no header in which case see https://stackoverflow.com/a/67306619/2836621 or raw as in Adobe Camera Raw/DNG/Bayer CFA? In ether case, **wand** can process them see https://pypi.org/project/Wand/ – Mark Setchell May 04 '21 at 20:29
  • @MarkSetchell Raw pixel data, no header, just a 2D matrix of bayered or RGB values. – TheTomer May 05 '21 at 10:25
  • If you can provide a sample file (e.g. via Dropbox or Google Drive) with dimensions and type, I can probably help you further... – Mark Setchell May 14 '21 at 22:07

1 Answers1

1

You may want to consider a commercial library such as the Leadtools SDK. It supports 16bpp color or extended grayscale and even 32, 48, and 64bpp images. Image processing commands for color correction, such as L_HistoEqualizeBitmap and L_TemperatureBitmap are available in C and C++ which you can access in Python using bindings. Just as a disclaimer, I work for this vendor.

https://www.leadtools.com/help/sdk/v21/main/api/l-histoequalizebitmap.html https://www.leadtools.com/help/sdk/v21/main/api/l-temperaturebitmap.html

Here's some sample code in C:

BITMAPHANDLE bitmap1;
BITMAPHANDLE bitmap2;

L_LoadBitmap("C:\temp\inputImage1.png", &bitmap1, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_TemperatureBitmap(&bitmap2, -200, 0);
L_SaveBitmap("C:\temp\outputImage1.png", &bitmap1, FILE_PNG, 24, 0, NULL);

L_LoadBitmap("C:\temp\inputImage2.png", &bitmap2, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
L_HistoEqualizeBitmap(&bitmap2, RGB_SPACE);
L_SaveBitmap("C:\temp\outputImage2.png", &bitmap2, FILE_PNG, 24, 0, NULL);

JClark742
  • 9
  • 3