How to Convert an Image to a High-Resolution PNG
Convert JPG, WebP or another image to PNG, resize it correctly, preserve transparency and avoid the limits of upscaling.
Short answer: converting a JPEG, WebP or other image to PNG changes the file format; it does not create missing detail. To make a PNG larger, set the required pixel dimensions and resample the image. For print, also set the required PPI. Keep an alpha-capable color mode when transparency matters.
What “high-resolution PNG” actually means
PNG is a file format. Resolution usually refers to one of two different properties:
- Pixel dimensions: the image width and height, such as 2,000 × 2,000 pixels. This is what websites, apps and most upload forms require.
- Pixel density: PPI (pixels per inch), which affects the physical size when the image is printed. Changing only PPI metadata does not add pixels.
Upscaling interpolates new pixel values from existing ones. It can satisfy a larger dimension requirement, but it cannot recover detail that was never present in the source. Inspect the result at its intended display or print size.
Choose the target before converting
| Destination | Decide first | Typical guidance |
|---|---|---|
| Website or app | Required pixel width and height, file-size limit, transparency | Follow the platform’s exact pixel requirement |
| Social or marketplace upload | Required pixel dimensions and aspect ratio | Use the service’s published dimensions |
| Physical size, pixel dimensions and requested PPI | Adobe lists 300 PPI as general print guidance | |
| Screen display | Rendered pixel dimensions | Adobe lists 72–96 PPI as general screen/web guidance |
Those PPI values are rules of thumb, not universal requirements. A printer or platform specification takes precedence.
Fastest command-line method with ImageMagick
Convert without resizing
magick input.jpg output.png
This changes the container format while keeping the original pixel dimensions. Check the dimensions before assuming the output is high resolution.
Resize inside a maximum bounding box
magick input.jpg -resize 2000x2000 output.png
The image keeps its aspect ratio. A 1600 × 900 source becomes 2000 × 1125 only if the bounding-box rules allow that enlargement; it will not necessarily become exactly 2000 × 2000.
Set exact dimensions
magick input.jpg -resize 2000x2000^ -gravity center -extent 2000x2000 output.png
The ^ enlarges until both sides cover the target, and -extent crops the excess. Use this only when cropping is acceptable.
Change print density without changing pixels
magick input.jpg -units PixelsPerInch -density 300 output.png
This changes density metadata. It does not increase the pixel count. Use -resize when the actual dimensions must change.
Inspect the result
magick identify -format "%f: %wx%h, %[channels], %[colorspace]%n" output.png
Python conversion and resizing with Pillow
Pillow supports common PNG modes including RGB and RGBA. RGBA preserves an alpha channel for transparency.
Convert to PNG
from PIL import Image
with Image.open("input.jpg") as image:
image.save("output.png", format="PNG")
Resize while preserving aspect ratio
from PIL import Image
max_size = (2000, 2000)
with Image.open("input.jpg") as image:
image.thumbnail(max_size, Image.Resampling.LANCZOS)
if image.mode not in ("RGB", "RGBA"):
image = image.convert("RGBA" if "A" in image.getbands() else "RGB")
image.save("output.png", format="PNG", optimize=True)
Set exact output dimensions
from PIL import Image
with Image.open("input.jpg") as image:
resized = image.resize((2000, 2000), Image.Resampling.LANCZOS)
resized.save("output.png", format="PNG")
Exact resizing can distort the subject. Use a crop or padding workflow when the aspect ratio must remain correct.
Preserve transparency
from PIL import Image
with Image.open("input.png") as image:
rgba = image.convert("RGBA")
rgba.save("output.png", format="PNG")
Pillow does not load truncated PNG files by default. If a source is incomplete, obtain a complete copy instead of silently producing a damaged conversion.
Photoshop workflow
- Open the source image.
- Choose Image > Image Size.
- Keep the aspect-ratio constraint enabled unless you intentionally want cropping or distortion.
- Enter the target pixel width or height.
- Enable Resample when the pixel dimensions must change. Adobe describes this as interpolating pixel information.
- Set resolution for the intended output, then confirm the resulting pixel dimensions.
- Export or save as PNG and verify transparency, color profile and dimensions.
Changing resolution with resampling disabled changes the nominal print size while keeping the same pixels. Resampling changes the pixel data.
GIMP workflow and PNG export settings
- Open the image and choose Image > Scale Image.
- Enter the required width and height. Keep the chain linked to preserve the aspect ratio.
- Choose an interpolation method and apply the scale.
- Choose File > Export As, use a filename ending in
.png, and export. - In the PNG dialog, select an RGB or grayscale format with alpha when transparency is needed.
PNG compression is lossless, so changing compression affects encoding time and file size rather than photographic quality. Indexed PNG8 has binary transparency only; soft shadows and anti-aliased edges can lose partial transparency. Preserve or intentionally convert color profiles and metadata for the destination workflow.
Transparency, color and metadata checklist
- Use RGBA or another alpha-capable mode for transparent backgrounds.
- Do not use indexed PNG8 when semi-transparent edges matter.
- Check the color profile if the image moves between design, web and print workflows.
- Decide whether metadata should be retained, stripped or converted.
- Verify dimensions, orientation and file size after export.
Common problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| The PNG is still blurry | The source lacks detail; conversion cannot restore it | Use a larger original, reduce the enlargement factor, or accept interpolation limits |
| Output is the wrong size | A bounding-box resize preserves aspect ratio | Use exact resizing, cropping with -extent, or add padding |
| Transparency became a solid color | The image was converted to RGB or exported without alpha | Keep RGBA/alpha enabled and inspect the PNG export settings |
| Edges look jagged or halos appear | Indexed transparency or an unsuitable resampling result | Use full RGB/RGBA PNG and compare the output at its final size |
| Print size changed unexpectedly | PPI metadata and pixel dimensions were confused | Set the physical size, PPI and pixel count separately |
| PNG file is much larger than the JPEG | PNG is lossless and often inefficient for photographs | Use PNG when you need losslessness or transparency; follow the destination’s format rules |
| Pillow refuses to open the file | The PNG may be truncated or incomplete | Re-download or regenerate the source file |
Performance, reliability and cost
- Batch conversions with ImageMagick or Pillow so the process is repeatable and scriptable.
- Use a maximum bounding box to avoid creating unnecessarily huge images.
- Large dimensions consume more memory and take longer to encode. Process files one at a time when memory is limited.
- Keep the original file and record the target dimensions, color mode and export settings.
- PNG encoding is lossless, but it is not always the smallest format for photographic images. Confirm the destination accepts PNG before converting.
Or skip the browser setup
If the image you need is actually a webpage capture, ScreenshotNeo can return a PNG directly from one GET request. See the ScreenshotNeo API docs for the available options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo removes cookie banners, newsletter popups and chat widgets before capture. Bot checks, blank pages and failed loads are not billed, and response headers identify the page verdict and billing status. Its MCP server lets AI agents take screenshots, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Does converting JPG to PNG improve quality?
No. It changes the format. Quality can only be preserved or changed through the resize and export process; missing source detail cannot be reconstructed.
What resolution should a PNG have?
Use the destination’s required pixel dimensions. For print, also use the requested physical size and PPI.
Can I make a small image suitable for a poster?
You can resample it to larger dimensions, but interpolation does not create original detail. A higher-resolution source is preferable.
Is PNG better than JPEG?
PNG is useful for lossless graphics and transparency. JPEG is often smaller for photographs. The correct choice depends on the destination requirements.
Why does my transparent PNG have a white background?
The alpha channel may have been removed during conversion or export. Keep an RGBA mode and verify the export settings.


