tweakpng | A low-level PNG image file manipulation utility for Windows | Computer Vision library
kandi X-RAY | tweakpng Summary
kandi X-RAY | tweakpng Summary
A Windows application for viewing and editing PNG metadata. For usage instructions, see tweakpng.txt. For development instructions, see tweakpng-src.txt.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tweakpng
tweakpng Key Features
tweakpng Examples and Code Snippets
Community Discussions
Trending Discussions on tweakpng
QUESTION
I used the DirectXTex
library to capture a screenshot of a DX11 game and save it to a file. The problem is that it works great when I save it as jpeg but if I save it as png the image would become super bright and washed out. I checked the image using TweakPNG
and found out the gamma was set to 1.0 and that's what's causing the problem.
I checked images taken by some other software including the snipping tool and they seem to use 0.45455 as gamma or they leave out the gamma value altogether.
I don't know if DirectXTex
will let me specify a gamma value or not. I'm not even sure if WIC
has this functionality as I can't seem to find useful information either on MSDN or other sites.
ANSWER
Answered 2018-Jun-25 at 22:45By default DirectXTex will add the sRGB
chunk to the PNG
file it writes if the format is DXGI_FORMAT_*_SRGB
. Furthermore, if the format is not DXGI_FORMAT_*_SRGB
I explicitly remove the sRGB
chunk and set the gAMA
chunk to 1.0 because otherwise WIC always adds the sRGB
chunk.
You can see this behavior in the code in both DirectXTexWIC.cpp and in the DirectX Tool Kit's ScreenGrab.cpp module.
If you are not doing 'gamma-correct' rendering where your render target is an DXGI_FORMAT_*_SRGB
format but have sRGB content in a DXGI_FORMAT_*
format, then my recommendation is that you pass an sRGB version of the format to the function.
In DirectXTex, that's easily done with the MakeSRGB
function.
Gamma correction in the PNG format is a bit of a mess. See this blog post
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tweakpng
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page