Comments (9)
Yes 16 Bit images often don't use the full dynamic range, resulting in completely black or white 8 Bit images when scaled to the data type min/max.
from oculante.
Thanks! When you say 16-bit grayscale images, could you elaborate a bit more? Oculante should be able to open 16-bit grayscale images. If I am reading it right, you want to influence / map how these images are displayed on the display?
Could you maybe add a screenshot / video showing how Fiji does it?
from oculante.
Thanks for the fast response and the interest :)
By 16-bit grayscale, I just mean a 2D array of uint 16-bit values stored as TIFF for instance (I attached an example TIFF image file. Sorry, I had to zip the file, because GitHub doesn't seem to support attaching TIFF directly).
Oculante should be able to open 16-bit grayscale images.
Ah ok, nice, that would be great :) I assumed that it doesn't support it, because I tried to open the attached example TIFF in Oculante and it only showed a black image without content, so I assumed it doesn't work. But maybe it expects a certain header / info in the TIFF? Or I should have adjusted the brightness / color range somewhere? (Sorry I'm not experienced with Oculante yet).
If I am reading it right, you want to influence / map how these images are displayed on the display?
I just meant, since it's 16-bit, the full color depth can't be shown on the screen at once, so you need to be able to select somehow which part of the 16-bit range should be shown. And for this selection, it's often useful to combine this with a histogram of the image, so that you can see what part of the bit range you're selecting relative to the histogram of the image.
Could you maybe add a screenshot / video showing how Fiji does it?
Sure thing. In Fiji, you can go to "Image" > "Adjust" > "Brightness / Contrast" (or press Ctrl + Shift + C). Then you have a small separate "B&C" window popping up, where you can see the histogram of the image in the background, and when you move the "Minimum" and "Maximum" sliders, you can set the range of the histogram you want to see, e.g. everything between pixel intensity 122 to 1400. (maybe in Fiji it's actually a bit more complicated than needed)
from oculante.
Great, thanks! Also very nice of you to attach a sample image!
For lots of "HDR" file formats like yours, I usually map them into the visible range somehow. This is especially useful in the movie/game industry where image data has a greater range than your display. I had a look and I don't do that for tiff yet which have more than 8 bits.
As a short-term fix, I could so automatic mapping based on min/max values and compress them into 8 bits.
Long-term, I am planning for Oculante to preserve the bit depth until the point where the image is displayed. Now, every image is converted to RGBA/8bpp when loaded, so the additional data is lost. I would love a 16 or 32 bit image to be loaded as that, so you have the option to apply any filter you like. At that point, you could probably replicate what you wrote above.
from oculante.
@woelper I think a min/max mapping for everything else than 8bit is a good idea.
For industrial imaging, this approach is widely used: https://www.mvtec.com/doc/halcon/13/en/disp_image.html
I had the same problem, and additionally a similar problem with not normalized float images.
Some info about the scaling, displayed in the UI could be a good idea, too.
from oculante.
Thanks! I am doing some basic tone mapping on >8 bit images already (png for example). I'll have a look at the link you provided.
I have started a branch for loading and preserving float images a long time ago, but I want to revisit how I handle them. Initially, I loaded everything as float but that results in excessive memory consumption. My idea is that instead of passing around RbgaImages, I want to load every format into a DynamicImage enum and then draw based on the image type. The filter operators mostly operate in float already, so you could apply a "levels" or brighness operator and scale the image as needed.
from oculante.
I've looked at it today - it seems I already do a simple mapping per value here (
Lines 794 to 799 in 1783609
from oculante.
I think this looks much better - using a pre-pass to determine the darkest/brightest values:
from oculante.
I merged the above and released a new version - let me know if that improves things!
from oculante.
Related Issues (20)
- MacOS: Command-Minus and Command-Plus make the UI elements get blurry and get sharp HOT 1
- Request: support Animated PNG (APNG) HOT 10
- Handle Associated alpha images HOT 11
- Oculante does not load single-channel EXR images HOT 4
- Use `image` internal formats
- Gifs piped into oculante do not animate HOT 3
- native wayland support HOT 2
- Ensure window size can't be too small HOT 1
- Webp images with large size don't get loaded HOT 1
- Image displayed wrong compared to other applications HOT 3
- Allow configurable min window size HOT 1
- No dependencies in Cargo.lock for build with options: --no-default-features notan/shaderc HOT 5
- error[E0599]: no variant or associated item named `get_mouse_position` found for enum `mouse_position::mouse_position::Mouse` in the current scope HOT 7
- heif support via avif-decode
- ERROR rfd::backend::xdg_desktop_portal HOT 5
- Transparency in images shows contents below oculante HOT 8
- GIFs increase in speed when workspace is switched HOT 1
- "Show checker background" option doesn't work" HOT 1
- A JPG file starting with 0x52 0x49 can't be opened HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oculante.