Page 1 of 1

density unit output

Posted: 2019-04-18T03:11:10-07:00
by angi_sfj
hi, i'm try to archive converting a bitmap to jpg cmyk ppi.
i set

Code: Select all

           using (MagickImage image = new MagickImage(bmp))
            {
              image.ColorAlpha(new MagickColor("#FFF")); // You only need this when your image contains transparency.
              image.Settings.Density = new Density(nBmpPrm.dpi, nBmpPrm.dpi, DensityUnit.PixelsPerInch);
              image.AddProfile(ColorProfile.SRGB);
              image.AddProfile(ColorProfile.CoatedFOGRA39);     // USWebCoatedSWOP
              image.Write(fullPath);
            }
but in gimp now i see

Code: Select all

JPEG image
5,9 × 5,9 pixels/mm
sRGB built-in Default RGB working space
what's wrong?

thankyou

Re: density unit output

Posted: 2019-04-18T03:11:39-07:00
by angi_sfj
the same if i remove
image.AddProfile(ColorProfile.SRGB);

Re: density unit output

Posted: 2019-04-18T04:49:56-07:00
by snibgo
What is wrong with your result?

I guess your nBmpPrm.dpi was 150, and 150 dots per inch is 5.9 dots per millimetre.

Re: density unit output

Posted: 2019-04-18T07:48:25-07:00
by angi_sfj
thanks for your reply.

color space results sRGB, not cmyk

and i'd archive resolution units pixels/mm, as if i open other random image that says 150 × 150 ppi.

Re: density unit output

Posted: 2019-04-18T08:08:37-07:00
by snibgo
Gimp can't process CMYK images, so those are converted to sRGB when they are read. To find the colorspace of the jpg file, I suggest you use exiftool.

Re: density unit output

Posted: 2019-04-18T08:57:40-07:00
by angi_sfj
grat thank you.
for color space it's ok.
but still here the file worked with

Code: Select all

DensityUnit.PixelsPerInch
results in a Resolution Unit : cm.
is it possibile to make it sign as Resolution Unit : inches as the original image is?
thankyou

Re: density unit output

Posted: 2019-04-28T06:41:28-07:00
by 246246
You said original image is bitmap. So as for a spec, its original unit is pixels per meter.
https://en.wikipedia.org/wiki/BMP_file_format

Re: density unit output

Posted: 2019-04-28T14:23:44-07:00
by angi_sfj
you're right, i make a shortcut in description.
My original image is jpg.
in my program to elaborate it I create a bitmap .net object.
if i save it with .net framework methods i get resolution in ppi
if i save it with imagemagick i get resolution in ppcm.

is it possibile to have an output jpg signed with Resolution Unit : inches ?

thank you