You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTML/CSS to Image supports converting html into png, jpg or webp. Learn how to specify the format of your image.
8
+
Learn about supported image formats (PNG, JPG, WebP) and how to optimize your image delivery.
9
9
---
10
-
# File formats
10
+
11
+
# Image File Formats
11
12
{: .no_toc }
12
13
{: .fs-9 }
13
14
14
-
Convert images from HTML to jpg, png or webp.
15
+
Choose the right format for your use case
15
16
{: .fs-6 .fw-300 }
16
17
17
18
<hr>
18
19
19
-
## File formats
20
+
Table of contents
21
+
{: .text-delta }
22
+
- TOC
23
+
{:toc}
24
+
25
+
<hr>
26
+
27
+
## Supported Formats
28
+
29
+
The API supports three image formats:
30
+
- PNG (default)
31
+
- JPG
32
+
- WebP
33
+
34
+
To specify a format, add the appropriate file extension to your image URL:
35
+
36
+
| Format | Example URL | Best For |
37
+
|:-------|:------------|:---------|
38
+
| PNG |`https://hcti.io/v1/image/abc123.png`| Screenshots, images with transparency |
39
+
| JPG |`https://hcti.io/v1/image/abc123.jpg`| Photos, complex images with no transparency |
40
+
| WebP |`https://hcti.io/v1/image/abc123.webp`| Modern web applications, optimal compression |
41
+
42
+
{% include hint.md title="Default Format" text="If no extension is specified, the API will return a PNG image." %}
43
+
44
+
## Format Characteristics
45
+
46
+
### PNG
47
+
- Lossless compression
48
+
- Supports transparency
49
+
- Larger file size
50
+
- Best for:
51
+
- Screenshots
52
+
- Images with text
53
+
- Graphics with sharp edges
54
+
- Content requiring transparency
55
+
56
+
### JPG
57
+
- Lossy compression
58
+
- No transparency support
59
+
- Smaller file size
60
+
- Best for:
61
+
- Photographs
62
+
- Complex images
63
+
- When transparency isn't needed
64
+
- When smaller file size is priority
65
+
66
+
### WebP
67
+
- Modern format
68
+
- Supports transparency
69
+
- Superior compression
70
+
- Best for:
71
+
- Web applications
72
+
- Progressive loading
73
+
- Optimal performance
74
+
- Modern browsers
75
+
76
+
## Automatic WebP Optimization
77
+
78
+
All paid accounts receive automatic WebP optimization:
79
+
80
+
1. Our edge servers detect the user's browser capabilities
81
+
2. If WebP is supported, images are automatically served in WebP format
82
+
3. Fallback formats are served for non-supporting browsers
20
83
21
-
The API supports `jpg`, `png` and `webp`. If no file extension is passed, you'll get back a png by default. If you need a different file format, adjust the extension on the url.
{% include hint.md title="Performance Tip" text="WebP typically provides 25-35% smaller file sizes compared to PNG/JPG while maintaining visual quality." %}
28
91
29
-
## Automatic next-gen format (WebP) - enabled for all customers
92
+
## Best Practices
30
93
31
-
It's [recommend by Google to serve your images](https://web.dev/uses-webp-images/) in next-gen formats (such as WebP).
94
+
### Format Selection
95
+
1.**Default to PNG** for:
96
+
- Screenshots
97
+
- Text-heavy images
98
+
- When quality is critical
99
+
100
+
2.**Use JPG** for:
101
+
- Photos
102
+
- Complex images
103
+
- When file size is priority
104
+
105
+
3.**Enable WebP** for:
106
+
- Modern web applications
107
+
- Performance optimization
108
+
- Progressive enhancement
32
109
33
-
- Improves your pagespeed
34
-
- Increases SEO
110
+
## Browser Support
35
111
36
-
Our edge servers will detect the browser being used to download an image. If the browser supports WebP, the image will be served in WebP.
0 commit comments