Advanced Features — Interactive API Debugger

60 multilingual fonts, 5000+ icons, 9 image formats (SVG, PNG, JPEG, WebP, AVIF), gradient textures, text highlighting — every parameter can be previewed in real time

MockImg placeholder live preview
Basic Settings
×
Ratio
No Padding
Ultra Compact1/20
Compact1/10
Moderate1/8
Loose1/6
Default1/5
Very Loose1/4
Maximum1/3
Vertical + Horizontal
Short Text1/10,1/20
Banner1/4,1/20
Top / Right / Bottom / Left
Title Area40,10,5,10
Left Nav20,10,20,60
Text Style
Auto
Background & Border
100%
Off
85
Icon Settings
Auto
Text Highlighting [View Guide]

Icon System

5000+ Tabler Icons with Outline and Filled styles, customizable size

Icon Size 48
Tabler Icons preview

Documentation & Reference

Complete API parameter reference, text highlighting guide, and icon-only display mode

Basic Syntax

Use {{...}} in the text parameter to wrap the parts you want highlighted. All highlighted segments share the same style. Tip: You can also type {{...}} directly in the Text Content input above — the system will detect and apply highlights automatically.

# Syntax Format
?text=Normal text{{highlighted text}}more normal text
&hlcolor=FF5733

Parameter Details

hlcolor Highlight Color

Sets the highlight color. Supports HEX format (e.g., FF5733) or color names (e.g., red).

Example: ?text=Mock{{Img}}.Dev&hlcolor=FF5733
hlcolor2 Highlight Gradient Color 2

Sets the second color for gradient highlight. Setting this automatically enables gradient effect, with hlcolor as the start color.

Example: ?text={{Hello}}&hlcolor=EC4899&hlcolor2=8B5CF6
hlgradient Highlight Gradient Direction

Sets the gradient direction. Defaults to horizontal when not set.

horizontal Horizontal (left to right) vertical Vertical (top to bottom) diagonal Diagonal (top-left to bottom-right)
Example: ?text={{Hello}}&hlcolor=EC4899&hlcolor2=8B5CF6&hlgradient=vertical
hlfont Highlight Font

Specifies an independent font for highlighted text. The value is the font file name (without the .ttf extension).

Example: ?text={{Brand}}&hlfont=Poppins-Bold
hlbold Highlight Bold

Makes highlighted text bold. Value: true or 1.

Example: ?text={{Important}}&hlbold=true

Full Examples

Example 1:Solid Color Highlight
https://mockimg.dev/600x400.png?text=Mock{{Img}}.Dev&hlcolor=FF5733

Effect:"MockImg.Dev" — Img shown in red

Example 2:Gradient Highlight
https://mockimg.dev/600x400.png?text={{Gradient}}&hlcolor=EC4899&hlcolor2=8B5CF6

Effect: "Gradient" shown in pink-to-purple horizontal gradient

Example 3:Custom Font Highlight
https://mockimg.dev/600x400.png?text={{MockImg}}&hlfont=Poppins-Bold&hlcolor=3B82F6

Effect: "MockImg" shown in blue with Poppins-Bold font

Example 4:Bold Highlight
https://mockimg.dev/600x400.png?text={{Important}}&hlbold=true&hlcolor=EF4444

Effect: "Important" shown in red and bold

Example 5:Combined (Gradient + Font + Bold)
https://mockimg.dev/600x400.png?text={{Premium}}&hlcolor=FFD700&hlcolor2=FF6B6B&hlgradient=diagonal&hlfont=Montserrat-Bold

Effect: "Premium" shown with diagonal gradient (gold to red) in Montserrat-Bold font

Example 6:Multi-segment Highlight
https://mockimg.dev/600x400.png?text={{MockImg}}+和+{{占位图}}&hlcolor=3B82F6

Effect: Both "MockImg" and placeholder text shown in blue (shared highlight style)

Example 7:Highlight in CJK Text
https://mockimg.dev/600x400.png?text={{MockImg}}+占位图服务&hlcolor=10B981

Effect: "MockImg" shown in green, remaining text uses default color

Example 8:Dark Theme + Highlight
https://mockimg.dev/600x400.png?theme=dark&text=Dark+{{Mode}}&hlcolor=FBBF24

Effect: In dark theme, "Mode" shown in gold highlight

Notes

  • {{...}} markers are not counted in text width calculations and do not affect layout
  • Nested {{...}} markers are not supported — inner markers are treated as plain text
  • All highlighted segments share the same hl* style settings
  • Highlighting works with all output formats (SVG, PNG, JPEG, WebP, AVIF, etc.)
  • Highlight markers work in multi-line text too (use \n for line breaks)

Trigger Conditions

  • Provided icon parameter
  • No text parameter, or text is empty

Icon Size Rules

Auto: icon size = 80% of the smaller image dimension (min 24px, max 90%)

Custom: use iconsize parameter to override auto calculation

Examples

Solid Color Icon
https://mockimg.dev/600x400.png?icon=outline/heart&iconcolor=FF5733

Effect: Heart icon auto-enlarged and centered in red

Gradient Icon
https://mockimg.dev/600x400.png?icon=filled/star&iconcolor=FFD700&iconcolor2=FF6B6B&icongradient=diagonal

Effect: Star icon with gold-to-red diagonal gradient

Transparent + Icon
https://mockimg.dev/200x200.png?icon=outline/user&iconcolor=3B82F6&bg=transparent

Effect: User icon on transparent background — perfect for avatars

Gradient Background + Rounded
https://mockimg.dev/600x400.png?icon=outline/heart&iconcolor=FFFFFF&gradient=horizontal&bgcolor2=EC4899&radius=20

Effect: White heart icon on pink gradient with rounded corners

Dark Theme + Icon
https://mockimg.dev/600x400.png?icon=filled/star&iconcolor=FFD700&theme=dark

Effect: Gold star icon on dark background

Circle Border (Avatar)
https://mockimg.dev/400x400.png?icon=outline/user&iconcolor=3B82F6&radius=200&border=4&bordercolor=3B82F6

Effect: User icon in circle with border — ideal for avatar placeholders

Icon+Text vs Icon-Only

Mode URL Effect
Icon-Only (no text) ?icon=outline/heart Icon auto-enlarged and centered, no text
Icon + Empty Text ?icon=outline/heart&text= Same as icon-only
Icon + Text ?icon=outline/heart&text=Love Icon and text side by side (original behavior)
No Icon No Text 600x400.png Dimension text (default behavior)

Notes

  • Works with all output formats (SVG, PNG, JPEG, WebP, AVIF, etc.)
  • All icon parameters (iconcolor, iconcolor2, icongradient, iconsize) work as expected
  • All background effects (transparent, gradient, pattern, noise, border, radius) can be combined with icon-only mode
  • Works with small sizes too — perfect for favicons: 32x32.ico?icon=filled/star&iconcolor=FFD700

Overview

The padding parameter controls the whitespace around text and icons inside the placeholder image. It supports 4 formats: single pixel value, single ratio, two-value (vertical + horizontal), and four-value (CSS-style clockwise).

# Supported formats
?padding=20
?padding=1/6
?padding=10,20
?padding=10,20,30,40

Default Behavior

When padding is not provided, built-in defaults are used (consistent with previous versions):

Left & Right: 5% of width Top & Bottom: 20% of height

Format Details

20 Single Pixel Value

All four sides use the same pixel value.

padding=20
1/6 Single Ratio Value

All four sides use a ratio. Top/Bottom based on image height, Left/Right based on image width. Results are automatically rounded.

padding=1/6  →  600×400 → top/bottom 67px, left/right 100px
10,20 Two Values (Vertical + Horizontal)

Control vertical and horizontal padding separately. Pixel and ratio values can be mixed.

padding=10,20  →  top/bottom 10px, left/right 20px
padding=1/8,15  →  top/bottom = height/8, left/right 15px
padding=30,1/10  →  top/bottom 30px, left/right = width/10
10,20,30,40 Four Values (CSS Clockwise)

CSS-style independent control: Top, Right, Bottom, Left. Top/Bottom based on image height, Left/Right based on image width. Pixel and ratio can be mixed.

padding=10,20,30,40  →  top 10, right 20, bottom 30, left 40 (all px)
padding=1/8,1/6,15,1/10  →  top h/8, right w/6, bottom 15px, left w/10 (mixed)

Examples

Short Text — Reduce Whitespace
https://mockimg.dev/480x200.svg?text=IP&bold=true&padding=1/10

Short text like "IP" with padding=1/10 for a more compact layout.

Zero Padding
https://mockimg.dev/600x400.svg?text=Full&padding=0

Set padding=0 to fill the entire image area with content.

Icon + Text — Compact Layout
https://mockimg.dev/600x400.svg?icon=outline/heart&text=Love&padding=1/8

Icon and text side by side with moderate padding.

Title Area — Top-Heavy Asymmetric
https://mockimg.dev/600x300.svg?text=Title&padding=40,10,5,10

Large top padding creates a title area feel, bottom is compact.

Left Navigation — Left-Heavy Asymmetric
https://mockimg.dev/800x400.svg?text=Content&padding=20,10,20,60

Large left padding to accommodate a left navigation bar.

Notes

  • Numerator and denominator in ratio values must be positive numbers
  • Pixel values cannot be negative — negative values are automatically corrected to 0
  • Ratio results are automatically rounded to whole pixels
  • If padding exceeds half the image dimensions, the content area may become very small and font size will automatically reduce to a minimum of 12px