Skip to content

askjeeves-tools/png-tools

Repository files navigation

Ask Jeeves mascot

PNG Converter

Convert PNG files in your browser. Nothing leaves your device.

Try it online: png.askjeeves.cc

More free tools: askjeeves.cc — PDF, images, CSV/JSON/Excel, Word, and more.

Supported conversions

Conversion Status Notes
PNG → JPEG Enabled Quality + max width options; max ~50 MB
PNG → WebP Enabled Quality + max width options; max ~50 MB
Convert to PDF Enabled Max ~50 MB
Convert to Base64 Enabled .base64.txt output
Crop image Enabled Interactive crop box
Compress image Enabled Quality slider
Compress images (batch) Enabled Requires ≥2 files; ZIP output

How it works

All conversion runs in your browser. Files are never uploaded to a server. Shared UI and validation live in vendored @askjeeves/* packages under vendor/. This repo wires tool.config.ts to processor functions in src/scripts/processors.ts.

Requirements

Requirement Version
Node.js ≥ 22.12
pnpm 10.27+

Enable pnpm once if needed:

corepack enable pnpm

Use pnpm, not npm — a preinstall script enforces this.

Install and run

git clone https://github.com/askjeeves-tools/png-tools.git
cd png-tools
pnpm install
pnpm dev

Open http://localhost:4321.

Build and preview

pnpm build      # output → dist/
pnpm preview    # serves dist/ locally

Do not open dist/index.html via file:// — ES modules require a local server.

Deploy

Option A — Cloudflare Pages (built-in)

pnpm deploy

This runs pnpm build then wrangler pages deploy dist. Log in first with wrangler login. Configuration lives in wrangler.toml.

First-time Cloudflare setup:

  1. Create a Cloudflare Pages project (or let Wrangler create one on first deploy).
  2. In the Cloudflare dashboard, open the project → Custom domains → add png.askjeeves.cc.
  3. Add the DNS record Cloudflare provides (typically a CNAME to your Pages hostname).

GitHub repo setup (for askjeeves-tools/png-tools):

  1. Create a public repo named png-tools in the askjeeves-tools org.
  2. Push this directory (source, vendor/, pnpm-lock.yaml, config files — not node_modules/ or dist/).
  3. Set the repo website to https://png.askjeeves.cc and topics such as astro, png, image-converter, browser, cloudflare-pages.

Option B — Any static host

After pnpm build, upload the contents of dist/ to Netlify, Vercel, GitHub Pages, S3, or any static host. No server-side runtime is required.

Scripts

Script Purpose
dev Astro dev server
build Static production build
preview Preview dist/
deploy Build + Cloudflare Pages deploy
test:e2e Playwright end-to-end tests (see below)
lint Biome check

Packages

Runtime dependencies

Package Role
astro Static site framework
@askjeeves/ui Layout, converter UI, client controller
@askjeeves/conversion-core Config, validation, errors, file limits
@askjeeves/astro-integration Astro plugin, branding globals
@askjeeves/processors-images PNG conversion, crop, compress, PDF, Base64

The five @askjeeves/* packages are vendored under vendor/@askjeeves/ and linked via file: paths in package.json. You do not install them separately.

Dev dependencies

Package Role
typescript Type checking
@playwright/test End-to-end tests
wrangler Cloudflare Pages deploy

Transitive (via processors)

pdf-lib (PNG → PDF) and JSZip (batch compress) are pulled in automatically by @askjeeves/processors-images. Image format conversion uses the browser Canvas API.

Tests

End-to-end tests under tests/e2e/ use local helpers in tests/e2e/helpers.ts and fixtures in tests/fixtures/. No external @askjeeves/test-e2e package is required.

pnpm test:e2e

Errors users may see

Failures appear in #tool-status with accessible error styling. Common cases:

Situation What to do
Wrong file type Upload a PNG file
File too large Use a smaller file (max ~50 MB, lower for some conversions)
Invalid file content Use a valid PNG file
Conversion failed Try different options or another file
Cancelled Click Convert again
Load / engine error Refresh the page
Converter failed to start Refresh the page

For maintainers

This repo was exported from the Ask Jeeves Modules monorepo as a self-contained project. Shared packages live in vendor/@askjeeves/.

UI & SEO architecture: See docs/UI-AND-SEO-ARCHITECTURE.md for the full guide to replicating this interface and SEO stack in sibling Ask Jeeves tool sites.

Do not copy tools/png-tools/ directly from the monorepo — that folder uses workspace:* dependencies that only resolve inside the monorepo. To re-export after upstream changes:

node scripts/export-standalone-tool.mjs png-tools ./export/png-tools

See docs/sub-projects.md in the upstream repo. See also STANDALONE.md.

About

Browser-based PNG converter (PNG to JPEG, WebP, PDF, Base64, crop, compress)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors