Jump to content
You must now use your email address to sign in [click for more info] ×

Still wrong DPI resolution for PNG export


Recommended Posts

If you export an image with 96 DPI as PNG, the PNG file has a wrong resolution, namely 96.01 DPI. This makes all my images unusable because I am a software developer and use the images in my software to display them in the GUI. I am dependent on the correct resolution. As long as the error is not fixed, I have to correct the resolution in a different program every time afterwards. This is very annoying.

Link to comment
Share on other sites

2 hours ago, MEB said:

Hi @Bent U.,
Welcome to Affinity Forums :)
Where are you seeing these dpi values (in what app)? Do you mind attaching a simplified afdesign file from which the exported PNG fails to have proper dpi values please? Thanks.

I could not get anything else out of Designer than 96.0 in metadata.

@MEBWhen I export selection with/without background metadata is not exported even though checked in export settings. Bug?

  • "The user interface is supposed to work for me - I am not supposed to work for the user interface."
  • Computer-, operating system- and software agnostic; I am a result oriented professional. Look for a fanboy somewhere else.
  • “When a wise man points at the moon the imbecile examines the finger.” ― Confucius
  • Not an Affinity user og forum user anymore. The software continued to disappoint and not deliver.
Link to comment
Share on other sites

Hi MEB,
thanks for your reply. I have attached a sample file. Paint.net is the program I use to correct the resolution (CTRL+R - Resize). There you can also see the wrong resolution of 96,01 DPI. As I said I use my images to build them into my own software and in Microsoft Visual Studio I can also see the wrong resolution when I use the debugger.
Unfortunately IrfanView does not help in this case, because it only shows the resolution as integers (horizontal and vertical).

Sample_96_DPI.afdesign

Link to comment
Share on other sites

Exiftool also reports an exported PNG as 96.0.

@Bent U.: Could you give us the corresponding exported PNG file, too, please?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

16 minutes ago, walt.farrell said:

Exiftool also reports an exported PNG as 96.0.

@Bent U.: Could you give us the corresponding exported PNG file, too, please?

I would like to believe that paint.net is wrong, but the fact is that I can set 96 DPI in paint.net, and then the images are displayed correctly in my software.

Sample_96_DPI.png

PaintDotNet_Resize.png

Link to comment
Share on other sites

@Bent U.: Please zip the png file before uploading. (Sorry, I should have mentioned that before. The forum software massages the formats that it supports (PNG, JPG) and can change them, as (I believe) it has when you just posted your .png file.)

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 minute ago, haakoo said:

I meant the real exported png not the outcome from ps

Oh dear, I mixed this discussion up with someone who wanted to export with 96.2 dpi. Nevertheless, when I export 96 dpi document from AD I get 96.0 dpi in xnviewmp and 96.012 dpi in PS. Sorry for the confusion.

------
Windows 10 | i5-8500 CPU | Intel UHD 630 Graphics | 32 GB RAM | Latest Retail and Beta versions of complete Affinity range installed

Link to comment
Share on other sites

4 minutes ago, haakoo said:

It's an afdesign file @walt.farrell so no (I think) conversion by forum software

I asked for (and Brent provided) the .png file just before I asked for the .zip.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

11 minutes ago, haakoo said:

But you rightfully pointed out that forum software may alter common image formats which should not be happening with the already provided afdesign file which contained the original png file which also does show the same results when viewed with xnviewmp

No, the .afdesign file can be Exported into a png, but it does not contain the png file. And even if it did, Brent's complaint is about how it was exported, so we need to see the actual exported file.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

I got the DPI from the metadata in the file read in A file Viewer. Maybe some binary data in the file are different,

  • "The user interface is supposed to work for me - I am not supposed to work for the user interface."
  • Computer-, operating system- and software agnostic; I am a result oriented professional. Look for a fanboy somewhere else.
  • “When a wise man points at the moon the imbecile examines the finger.” ― Confucius
  • Not an Affinity user og forum user anymore. The software continued to disappoint and not deliver.
Link to comment
Share on other sites

Okay, I got it. The resolution in PNG files is always stored in pixels per meter, as an integer. 96 DPI corresponds to 3779.5275590551181102362204724409 dots per meter. Affinity Designer saves this as 3780, and paint.net saves 3779.

Link to comment
Share on other sites

1 hour ago, Bent U. said:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.5.0">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
    xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
    xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
   exif:PixelXDimension="80"
   exif:PixelYDimension="22"
   exif:ColorSpace="1"
   tiff:ImageWidth="80"
   tiff:ImageLength="22"
   tiff:ResolutionUnit="2"
   tiff:XResolution="96.0"
   tiff:YResolution="96.0"
   photoshop:ColorMode="3"
   photoshop:ICCProfile="sRGB IEC61966-2.1"
   xmp:ModifyDate="2020-10-07T12:35:36+02:00"
   xmp:MetadataDate="2020-10-07T12:35:36+02:00">
   <dc:title>
    <rdf:Alt>
     <rdf:li xml:lang="x-default">Sample_96_DPI</rdf:li>
    </rdf:Alt>
   </dc:title>
   <xmpMM:History>
    <rdf:Seq>
     <rdf:li
      stEvt:action="produced"
      stEvt:softwareAgent="Affinity Designer 1.8.5"
      stEvt:when="2020-10-07T12:35:36+02:00"/>
    </rdf:Seq>
   </xmpMM:History>
  </rdf:Description>
 </rdf:RDF>
</x:xmpmeta>

 

  • "The user interface is supposed to work for me - I am not supposed to work for the user interface."
  • Computer-, operating system- and software agnostic; I am a result oriented professional. Look for a fanboy somewhere else.
  • “When a wise man points at the moon the imbecile examines the finger.” ― Confucius
  • Not an Affinity user og forum user anymore. The software continued to disappoint and not deliver.
Link to comment
Share on other sites

1 hour ago, Bent U. said:

Okay, I got it. The resolution in PNG files is always stored in pixels per meter, as an integer. 96 DPI corresponds to 3779.5275590551181102362204724409 dots per meter. Affinity Designer saves this as 3780, and paint.net saves 3779.

Interesting. That may help explain one set of numbers that I got which puzzled me, but which I had not yet investigated. PaintShop Pro reported:

image.png.56e5c4ad4bdc5d7d95f57cb726622c87.png

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.