Search found 9 matches

by djc88
2016-12-22T10:01:45-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

I don't know the OpenJpeg version. I do know that the Magick.NET version is 7.0.3.500-Q8-x86.

I've created an Issue on the Magick.NET website and uploaded a test 8-bit bitmap image. See here for a link.
by djc88
2016-12-21T14:08:52-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

Both command line examples here, you report the same file size of 1,716 KB contrary to your statement at the top that the file sizes change. No; please read the numbers more closely. The change without changing ColorSpace to gray is 1,716 KB, and with changing ColorSpace, it's 1,176 KB. I may have ...
by djc88
2016-12-21T13:53:12-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

The reason I am suspicious of these changes is that the file size does change substantially when I convert the files via the command line. I begin with an 8-bit grayscale bitmap file, test.bmp. With the command convert test.bmp test.jp2 , the file size of test.jp2 is 1,716 KB. With the command conve...
by djc88
2016-12-21T13:30:54-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

Sorry to make multiple posts, but I do have one more finding: changing the property Settings.ColorType has no effect at all; Number Of Components remains 3, Color Space is sRGB, and file size is unchanged (1,716 KB). I also read ( see here ) that the "DetermineColorType" function sometimes changes t...
by djc88
2016-12-21T13:16:05-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

One more thing: changing the "ColorSpace" of the MagickImage has the same effect as I described in the previous post: changed metadata, but only marginal change in file size.

Added this line of code before the "SetDefine" command:

Code: Select all

m.ColorSpace = ColorSpace.Gray;
by djc88
2016-12-21T13:06:19-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Re: Gray colorspace not working when encoding JPEG-2000

I've added a change to the ColorType as follows: using (MagickImage m = new MagickImage(bmp)) { m.Format = MagickFormat.Jp2; //m.Settings.SetDefine(MagickFormat.Jp2, "colorspace", "gray"); m.Settings.ColorSpace = ColorSpace.Gray; m.ColorType = ColorType.Grayscale; m.Settings.SetDefine(MagickFormat.J...
by djc88
2016-12-21T12:21:08-07:00
Forum: Magick.NET
Topic: Gray colorspace not working when encoding JPEG-2000
Replies: 10
Views: 12233

Gray colorspace not working when encoding JPEG-2000

I am attempting to create an 8-bit grayscale JPEG-2000 file with Magick.NET. (I am using the library found in the ZIP file Magick.NET-7.0.3.500-Q8-x86.) I can create a valid jp2 file, but no matter what I do, the file always has an RGB colorspace and 3 bands. User "snibgo" explained to me ( see here...
by djc88
2016-12-21T12:11:40-07:00
Forum: Users
Topic: Is it possible to create 8-bit grayscale JPEG-2000?
Replies: 2
Views: 2608

Re: Is it possible to create 8-bit grayscale JPEG-2000?

I think you're right; I've verified it for myself with ImageMagick's command-line "convert" command. I've tried setting the colorspace to Gray in two ways in my C# code (by uncommenting one of the commented lines at a time): using (MagickImage m = new MagickImage(bmp)) { m.Format = MagickFormat.Jp2;...
by djc88
2016-12-21T11:00:34-07:00
Forum: Users
Topic: Is it possible to create 8-bit grayscale JPEG-2000?
Replies: 2
Views: 2608

Is it possible to create 8-bit grayscale JPEG-2000?

I am attempting to use Magick.NET to create JPEG-2000 images in C#. (My library came from the ZIP file Magick.NET-7.0.3.500-Q8-x86.) I'm starting from a data array of bytes, creating a C# Bitmap object (called "bmp"), creating a MagickImage from that Bitmap, and writing to a file: using (MagickImage...