Click here to Skip to main content
15,884,099 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question16bit grayscale png export? (and import?) Pin
primem0ver22-Feb-18 10:00
primem0ver22-Feb-18 10:00 
AnswerRe: 16bit grayscale png export? (and import?) Pin
Gerry Schmitz22-Feb-18 11:49
mveGerry Schmitz22-Feb-18 11:49 
GeneralRe: 16bit grayscale png export? (and import?) Pin
primem0ver22-Feb-18 13:47
primem0ver22-Feb-18 13:47 
GeneralRe: 16bit grayscale png export? (and import?) Pin
Gerry Schmitz22-Feb-18 14:07
mveGerry Schmitz22-Feb-18 14:07 
AnswerRe: 16bit grayscale png export? (and import?) Pin
Eddy Vluggen22-Feb-18 14:17
professionalEddy Vluggen22-Feb-18 14:17 
GeneralRe: 16bit grayscale png export? (and import?) Pin
primem0ver22-Feb-18 15:54
primem0ver22-Feb-18 15:54 
GeneralRe: 16bit grayscale png export? (and import?) Pin
Eddy Vluggen23-Feb-18 3:16
professionalEddy Vluggen23-Feb-18 3:16 
GeneralRe: 16bit grayscale png export? (and import?) Pin
primem0ver23-Feb-18 10:37
primem0ver23-Feb-18 10:37 
Hmm... well it appears that either you don't understand colorspaces and how color values work, or you didn't realize that I am trying to display the picture while working on it (which to me is a given). Doing what you suggest will not produce a grayscale picture as assigning a pixel in ARGB format the value of 65535 will give the G (green) channel a value of 255 and a blue channel value of 255 (making yellow) and an ARGB pixel value of 255 will give solid blue.

Furthermore, when .NET reads a 16bit grayscale picture, it DOES use the ARGB (specifically the 32bbpARGB) format and it DOES loose the data because it truncates the 16 bit value to an 8 bit value, losing the less significant bits (so 65535 is read as 255 and 255 is read as zero). You can find documentation about this issue all over the internet. It has the same effect as dividing the 16 bit values by 256. It then fills each of the color channels (RGB) with this 8 bit value so that they are all the same, giving a grayscale picture. Otherwise, you would not see a grayscale picture. If you then try to save the file, it will result in an 8bit grayscale picture. If you try using the 16bbpGrayscale pixel format and then try to save it, .NET throws an exception because 16 bit grayscale picture loading and saving are not supported by .NET (hence the need for this thread).

modified 23-Feb-18 16:53pm.

GeneralRe: 16bit grayscale png export? (and import?) Pin
Eddy Vluggen23-Feb-18 23:31
professionalEddy Vluggen23-Feb-18 23:31 
AnswerRe: 16bit grayscale png export? (and import?) Pin
Richard Deeming23-Feb-18 0:55
mveRichard Deeming23-Feb-18 0:55 
GeneralRe: 16bit grayscale png export? (and import?) Pin
primem0ver23-Feb-18 10:49
primem0ver23-Feb-18 10:49 
AnswerRe: 16bit grayscale png export? (and import?) Pin
Gerry Schmitz23-Feb-18 15:04
mveGerry Schmitz23-Feb-18 15:04 
QuestionCreating a Designer Compatible ToolStripControlHost? Pin
primem0ver17-Feb-18 10:44
primem0ver17-Feb-18 10:44 
Questionpassing data prom one thread to another Pin
galba201814-Feb-18 21:15
galba201814-Feb-18 21:15 
AnswerRe: passing data prom one thread to another Pin
Richard MacCutchan14-Feb-18 22:07
mveRichard MacCutchan14-Feb-18 22:07 
QuestionProcesses list in Windows CE (.NET Compact Framework) Pin
steve_949661314-Feb-18 5:29
professionalsteve_949661314-Feb-18 5:29 
AnswerRe: Processes list in Windows CE (.NET Compact Framework) Pin
Eddy Vluggen14-Feb-18 6:11
professionalEddy Vluggen14-Feb-18 6:11 
GeneralRe: Processes list in Windows CE (.NET Compact Framework) Pin
steve_949661314-Feb-18 20:52
professionalsteve_949661314-Feb-18 20:52 
QuestionPerformance and memory optimization Pin
Super Lloyd13-Feb-18 14:31
Super Lloyd13-Feb-18 14:31 
AnswerRe: Performance and memory optimization Pin
Super Lloyd13-Feb-18 14:59
Super Lloyd13-Feb-18 14:59 
GeneralRe: Performance and memory optimization Pin
Nathan Minier15-Feb-18 2:05
professionalNathan Minier15-Feb-18 2:05 
SuggestionRe: Performance and memory optimization Pin
Richard Deeming15-Feb-18 2:14
mveRichard Deeming15-Feb-18 2:14 
GeneralRe: Performance and memory optimization Pin
Nathan Minier15-Feb-18 2:36
professionalNathan Minier15-Feb-18 2:36 
QuestionHow to programmatically add columns to wpf datagrid with MVVM? Pin
Member 135455647-Feb-18 22:12
Member 135455647-Feb-18 22:12 
AnswerRe: How to programmatically add columns to wpf datagrid with MVVM? Pin
Gerry Schmitz8-Feb-18 8:44
mveGerry Schmitz8-Feb-18 8:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.