<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: pawan kumar</title>
    <description>The latest articles on DEV Community by pawan kumar (@pawan_kumar_e9a0709296027).</description>
    <link>https://dev.to/pawan_kumar_e9a0709296027</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4071841%2Fbc53e8f2-7a4a-4f65-8928-f6217b8dd083.jpg</url>
      <title>DEV Community: pawan kumar</title>
      <link>https://dev.to/pawan_kumar_e9a0709296027</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pawan_kumar_e9a0709296027"/>
    <language>en</language>
    <item>
      <title>How to Inject 300 DPI Losslessly Into JPEG &amp; PNG Files in the Browser (JFIF APP0 &amp; PNG pHYs)</title>
      <dc:creator>pawan kumar</dc:creator>
      <pubDate>Mon, 30 Nov 2026 05:13:34 +0000</pubDate>
      <link>https://dev.to/pawan_kumar_e9a0709296027/how-to-inject-300-dpi-losslessly-into-jpeg-png-files-in-the-browser-jfif-app0-png-phys-3n5l</link>
      <guid>https://dev.to/pawan_kumar_e9a0709296027/how-to-inject-300-dpi-losslessly-into-jpeg-png-files-in-the-browser-jfif-app0-png-phys-3n5l</guid>
      <description>&lt;p&gt;Most web tools "convert to 300 DPI" by redrawing the image onto an HTML5 &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; and re-encoding it — which silently triggers JPEG lossy recompression and degrades print sharpness.&lt;/p&gt;

&lt;p&gt;Instead, DPI in standard image files is purely a metadata header:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JPEG (&lt;code&gt;JFIF APP0&lt;/code&gt;):&lt;/strong&gt; Bytes inside the &lt;code&gt;FF E0&lt;/code&gt; marker segment define &lt;code&gt;units&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt; = dots per inch) and &lt;code&gt;Xdensity&lt;/code&gt; / &lt;code&gt;Ydensity&lt;/code&gt; as 16-bit big-endian integers (&lt;code&gt;0x012C&lt;/code&gt; = 300).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PNG (&lt;code&gt;pHYs&lt;/code&gt; chunk):&lt;/strong&gt; Stores Pixels Per Unit in &lt;strong&gt;pixels per meter&lt;/strong&gt; (&lt;code&gt;Math.round(300 / 0.0254) = 11811&lt;/code&gt;) plus a recalculated CRC32 checksum.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By reading and patching these binary segments directly with JavaScript &lt;code&gt;Uint8Array&lt;/code&gt; slices, you get true lossless 300 DPI output in milliseconds without touching a single pixel.&lt;/p&gt;

&lt;h3&gt;
  
  
  Live Tools Built With This Browser-First Approach
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lossless 300 DPI Print Studio:&lt;/strong&gt; &lt;a href="https://www.simpleimageconvert.com/change-image-dpi" rel="noopener noreferrer"&gt;Change Image DPI Studio&lt;/a&gt; (includes JFIF/pHYs hex inspector, 2.5x loupe, and batch ZIP export)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2D Game Dev Tooling:&lt;/strong&gt; &lt;a href="https://www.simpleimageconvert.com/sprite-sheet-cutter" rel="noopener noreferrer"&gt;Sprite Sheet Cutter &amp;amp; Animator&lt;/a&gt; (grid/tile slicer with live FPS preview + Godot/Unity JSON export)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop-in Site Widget:&lt;/strong&gt; &lt;a href="https://www.simpleimageconvert.com/image-resizer-widget" rel="noopener noreferrer"&gt;Embeddable Image Resizer Widget&lt;/a&gt; (&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt; embed for blogs and apps)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy to answer questions about binary chunk parsing in client-side JS!``&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>gamedev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
