Xamarin.Forms how can I save a JPG with a 8 bit colour depth?











up vote
0
down vote

favorite












I have spent all afternoon researching this but I have not been able to find a solution. For reasons out of my control when I send a photo to the web service I deal with it can only handle jpgs with a pixeldepth of 8 bits (don't ask). Typically the camera will return 24 bit pixel depth jpgs. My app is written in Xamarin.Forms (.NET Standard, not PCL) and is currently implemented on Android though iOS will be supported in the future. I have had a look at the following article regarding .NET core image processing (note I cannot use the System.Drawing namespace):



https://blogs.msdn.microsoft.com/dotnet/2017/01/19/net-core-image-processing/



I have had a play with the follwing libraries but I have been unable to produce an 8 bit colour jpg with any of them:




  • SkiaSharp

  • ImageSharp

  • FreeImage-dotnet-core


Has anyone got any ideas? I can implement platform specific solutions via the DependencyService as long as there is a solution for both Android and iOS. Thanks.










share|improve this question






















  • you may need to do this natively in each platform and expose it to Forms via DependencyService
    – Jason
    Nov 22 at 17:12










  • I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
    – Mark Setchell
    Nov 22 at 17:49

















up vote
0
down vote

favorite












I have spent all afternoon researching this but I have not been able to find a solution. For reasons out of my control when I send a photo to the web service I deal with it can only handle jpgs with a pixeldepth of 8 bits (don't ask). Typically the camera will return 24 bit pixel depth jpgs. My app is written in Xamarin.Forms (.NET Standard, not PCL) and is currently implemented on Android though iOS will be supported in the future. I have had a look at the following article regarding .NET core image processing (note I cannot use the System.Drawing namespace):



https://blogs.msdn.microsoft.com/dotnet/2017/01/19/net-core-image-processing/



I have had a play with the follwing libraries but I have been unable to produce an 8 bit colour jpg with any of them:




  • SkiaSharp

  • ImageSharp

  • FreeImage-dotnet-core


Has anyone got any ideas? I can implement platform specific solutions via the DependencyService as long as there is a solution for both Android and iOS. Thanks.










share|improve this question






















  • you may need to do this natively in each platform and expose it to Forms via DependencyService
    – Jason
    Nov 22 at 17:12










  • I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
    – Mark Setchell
    Nov 22 at 17:49















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have spent all afternoon researching this but I have not been able to find a solution. For reasons out of my control when I send a photo to the web service I deal with it can only handle jpgs with a pixeldepth of 8 bits (don't ask). Typically the camera will return 24 bit pixel depth jpgs. My app is written in Xamarin.Forms (.NET Standard, not PCL) and is currently implemented on Android though iOS will be supported in the future. I have had a look at the following article regarding .NET core image processing (note I cannot use the System.Drawing namespace):



https://blogs.msdn.microsoft.com/dotnet/2017/01/19/net-core-image-processing/



I have had a play with the follwing libraries but I have been unable to produce an 8 bit colour jpg with any of them:




  • SkiaSharp

  • ImageSharp

  • FreeImage-dotnet-core


Has anyone got any ideas? I can implement platform specific solutions via the DependencyService as long as there is a solution for both Android and iOS. Thanks.










share|improve this question













I have spent all afternoon researching this but I have not been able to find a solution. For reasons out of my control when I send a photo to the web service I deal with it can only handle jpgs with a pixeldepth of 8 bits (don't ask). Typically the camera will return 24 bit pixel depth jpgs. My app is written in Xamarin.Forms (.NET Standard, not PCL) and is currently implemented on Android though iOS will be supported in the future. I have had a look at the following article regarding .NET core image processing (note I cannot use the System.Drawing namespace):



https://blogs.msdn.microsoft.com/dotnet/2017/01/19/net-core-image-processing/



I have had a play with the follwing libraries but I have been unable to produce an 8 bit colour jpg with any of them:




  • SkiaSharp

  • ImageSharp

  • FreeImage-dotnet-core


Has anyone got any ideas? I can implement platform specific solutions via the DependencyService as long as there is a solution for both Android and iOS. Thanks.







image-processing xamarin.forms .net-core .net-standard






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 at 17:05









David Christopher Reynolds

408723




408723












  • you may need to do this natively in each platform and expose it to Forms via DependencyService
    – Jason
    Nov 22 at 17:12










  • I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
    – Mark Setchell
    Nov 22 at 17:49




















  • you may need to do this natively in each platform and expose it to Forms via DependencyService
    – Jason
    Nov 22 at 17:12










  • I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
    – Mark Setchell
    Nov 22 at 17:49


















you may need to do this natively in each platform and expose it to Forms via DependencyService
– Jason
Nov 22 at 17:12




you may need to do this natively in each platform and expose it to Forms via DependencyService
– Jason
Nov 22 at 17:12












I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
– Mark Setchell
Nov 22 at 17:49






I think you are getting "confuzzled" TM by the terminology! When folks say an 8-bit JPEG, they are referring to 8-bits per channel for each of 3 channels so that is effectively 24-bits.
– Mark Setchell
Nov 22 at 17:49



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435581%2fxamarin-forms-how-can-i-save-a-jpg-with-a-8-bit-colour-depth%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435581%2fxamarin-forms-how-can-i-save-a-jpg-with-a-8-bit-colour-depth%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Trompette piccolo

Slow SSRS Report in dynamic grouping and multiple parameters

Simon Yates (cyclisme)