> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bitiful.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bitiful.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.bitiful.com/_biti/feedback/agent.

# Social and communities

> Design image and video uploads, processing, and delivery for social apps, community forums, and interest groups: direct uploads from the client, multiple sizes for avatars and feeds, placeholders, Live Photos and HDR, face blurring, signed access to private content, hotlink protection, and monitoring trending content.

Content in social and community products comes from users: avatars, post images, short videos, and Live Photos. There's a lot of it, the formats vary, and traffic concentrates on a small amount of popular content. You need users to **post quickly and scroll smoothly**, protect **private content and personal privacy**, and stop other websites from hotlinking your images.

## Common challenges

| Challenge                     | What it looks like                                                                                                |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Many upload entry points      | iOS, Android, mini programs, and websites all upload, and keys can't be shipped in the client                     |
| Many sizes                    | The same image appears at different sizes in avatars, feeds, detail pages, and share cards                        |
| Mixed formats                 | HEIC, Live Photos, HDR photos, and many video codecs                                                              |
| Feeds need to scroll smoothly | Slow image loading and layout shifts reduce time spent in the app                                                 |
| Privacy                       | Public content contains passersby's faces, and direct messages and private albums must not be directly accessible |
| Hotlinking and spikes         | Popular images get embedded by other websites, and traffic spikes without you knowing where it comes from         |

## Industry examples

> **Note**
>
> The products mentioned here only illustrate common needs in the industry and don't imply that they use Bitiful.

### Make every HDR photo shine: Xiaohongshu (RedNote) as an example

**Background**: Today's flagship phones shoot HDR photos by default, with brighter highlights and more detail in the shadows. Image communities such as Xiaohongshu (RedNote) already support displaying HDR, but they're fairly strict about uploaded HDR originals. Phones, cameras, and photo editors from different brands export HDR in all kinds of formats, and files that don't meet the requirements often lose their HDR effect after upload, compression, or watermarking, so the "bright" image users see isn't what they shot.

**The hard part**: Building HDR compatibility yourself means understanding several approaches at once, including gain maps (Ultra HDR), PQ, and HLG, and keeping the HDR information in sync at every step of resizing, compression, and watermarking. Get any step wrong, and the result loses its HDR, looks washed out, or ends up with a glaring watermark.

**How Bitiful helps**:

| Stage      | Capability                                                                                                                                                                                                                |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Reading    | Recognizes gain map photos (JPEG Ultra HDR, HEIC including iPhone photos, AVIF), PQ / HLG images (HEIC, AVIF, JPEG XL, PNG), camera RAW (including Apple ProRAW), and OpenEXR, as well as PQ, HLG, and Dolby Vision video |
| Processing | Cropping, resizing, rotation, compression, format conversion, and watermarks are all applied to the HDR information too, and the output is still HDR                                                                      |
| Output     | JPEG with a gain map by default: HDR screens show HDR and standard screens show SDR automatically, so one image works on every device. For smaller files, choose AVIF (PQ, 10-bit)                                        |
| Watermarks | Both text and image watermarks can be overlaid on HDR photos. `mark-hdr-rate` controls the watermark's brightness on HDR screens, so the watermark isn't more glaring than the photo                                      |
| Fallback   | Where HDR isn't supported, add `hdr-rate=0` to map to SDR with natural color and no washed-out look                                                                                                                       |

```text
https://img.example.com/notes/8f3a/1.heic?w=1440&fmt=jpg&txt=@azi_travel&mark-hdr-rate=0.3
```

This link resizes an iPhone HDR photo to 1440 pixels wide, outputs a gain map JPEG that works on every device, and overlays an author watermark that isn't too bright on HDR screens.

**Result**: Whatever device took their HDR photos, users don't need to worry about the format, and the community shows the light just as it was when the photo was taken. The product doesn't need to maintain a separate processing pipeline for HDR. See [HDR images and video](https://docs.bitiful.com/en/coreix/hdr.md) and [Text watermarks](https://docs.bitiful.com/en/coreix/features/watermark.md).

### Support Live Photos without building it yourself: WeChat and Xiaohongshu (RedNote) as examples

**Background**: WeChat Moments and Xiaohongshu (RedNote) both support posting Live Photos: press and hold to see a few seconds of motion before and after the shot, and users are now used to it. To support Live Photos, a community product first has to accept the Live Photos shot on every brand of phone.

**The hard part**: Live Photos have no unified format. Apple's Live Photo is two files, a still image and a short video. Android manufacturers mostly embed the video inside the still image file, and each one writes it differently. Doing it yourself means parsing, extracting, and transcoding each format separately, then handling HDR, orientation, and watermarks for both the still image and the video, which is costly to develop and maintain.

**How Bitiful helps**:

| Capability             | Details                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Splitting              | Apple Live Photos and Live Photos from OPPO, vivo, and iQOO can be split into a still image and a video                                    |
| Conversion and merging | Convert between the Apple and Android approaches. Google, realme, Xiaomi, Huawei, and Honor formats can be used as conversion targets      |
| HDR                    | The still image keeps its HDR and goes through the same processing pipeline as ordinary HDR photos                                         |
| Watermarks             | Text or image watermarks can be overlaid on both the still image and the video, and watermarks on the video are just as accurate and sharp |
| Covers and previews    | The still image can be further resized, cropped, and turned into a placeholder for use as a feed cover                                     |

**Result**: Users upload the Live Photos on their phones as they are. The feed shows a watermarked still image, and opening it plays the motion part with the same watermark. The product saves the effort of building Live Photo parsing for multiple manufacturers in-house. See [Supported media formats](https://docs.bitiful.com/en/formats.md) for the supported formats, and contact support for the specific processing parameters.

## What each part of Bitiful does

| Capability                                                                                                                                                  | What it does here                                                                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Presigned URLs](https://docs.bitiful.com/en/developer/s3/presigned-url.md)                                                                                 | Your server issues upload links and clients upload directly to S4 without going through your application servers. `x-bitiful-max-requests=1` makes a link single-use |
| [MIME auto-detection](https://docs.bitiful.com/en/best-practice/auto-detect-mime.md)                                                                        | Browsers recognize files correctly even when the client doesn't set `Content-Type` properly                                                                          |
| [Conditional requests](https://docs.bitiful.com/en/developer/s3/conditional-requests.md)                                                                    | `If-None-Match: *` keeps duplicate submissions from overwriting existing files                                                                                       |
| [Sub-user permissions](https://docs.bitiful.com/en/bitiful-s4/handbook/permissions.md)                                                                      | The backend that issues links is granted only the `uploads/` directory, which limits the damage if a key leaks                                                       |
| [CoreIX resizing and smart cropping](https://docs.bitiful.com/en/coreix/features/resize.md)                                                                 | Serves every size, including avatars, feeds, and detail pages, from one original. `pos=smart` keeps faces and subjects automatically                                 |
| [Format conversion](https://docs.bitiful.com/en/coreix/features/fmt.md)                                                                                     | `fmt=auto` outputs AVIF/WebP based on browser support, and HEIC displays correctly on web pages too                                                                  |
| [Live Photos](https://docs.bitiful.com/en/formats.md) and [HDR](https://docs.bitiful.com/en/coreix/hdr.md)                                                  | Splits Live Photos from iOS and major Android manufacturers into a still image and a video. HDR photos stay HDR after processing                                     |
| [BlurHash / ThumbHash](https://docs.bitiful.com/en/bitiful-s4/features/hash-placeholder.md)                                                                 | Feeds show a blurred placeholder first and swap in the image seamlessly when it arrives, with no layout shift                                                        |
| [Video frame extraction](https://docs.bitiful.com/en/coreix/features/frame.md)                                                                              | `frame=auto` picks a video cover automatically, avoiding black and blurry frames                                                                                     |
| [Face blurring](https://docs.bitiful.com/en/coreix/features/face-privacy.md)                                                                                | Automatically blurs or pixelates faces in publicly displayed images                                                                                                  |
| [Image analysis](https://docs.bitiful.com/en/coreix/features/analysis.md)                                                                                   | `fmt=phash` detects images posted repeatedly, and `fmt=tags` tags images automatically for recommendations                                                           |
| [Styles](https://docs.bitiful.com/en/coreix/handbook/styles.md) + [original file protection](https://docs.bitiful.com/en/coreix/handbook/origin-protect.md) | Allows access only through agreed styles, so originals can't be downloaded and parameters can't be abused                                                            |
| [CDN](https://docs.bitiful.com/en/cdn/intro.md) and [edge rules](https://docs.bitiful.com/en/cdn/handbook/rules.md)                                         | Caches popular content close to users; Referer hotlink protection, signatures for private directories, and blocking of unusual User-Agents                           |
| [Top content](https://docs.bitiful.com/en/console/popular.md) / [Usage](https://docs.bitiful.com/en/console/usage.md)                                       | See which content is taking off and which websites and regions the traffic comes from                                                                                |

## Recommended architecture

### Upload directly from the client

The client requests your backend → the backend verifies the user, generates a key such as `uploads/{userID}/{date}/{randomID}.{extension}`, and issues a single-use [PUT link](https://docs.bitiful.com/en/developer/s3/presigned-url.md) valid for 5 minutes → the client uploads directly to S4. For large files such as videos, the backend issues multipart upload links. See [Upload files securely from the client](https://docs.bitiful.com/en/best-practice/web-uploads.md).

### Define styles

Define a [style](https://docs.bitiful.com/en/coreix/handbook/styles.md) for each display location, and the frontend only appends the style name:

| Location           | Style name | Example parameters               |
| ------------------ | ---------- | -------------------------------- |
| Avatar             | `avatar`   | `w=200&h=200&pos=smart&fmt=auto` |
| Feed               | `feed`     | `w=720&fmt=auto&q=80`            |
| Large detail image | `detail`   | `w=1600&fmt=auto`                |
| Share card         | `share`    | `w=1200&h=630&pos=smart&fmt=jpg` |
| Video cover        | `cover`    | `frame=auto&w=720&fmt=auto`      |

### Turn on original file protection

On the bucket's **Media processing** tab, turn on [original file protection](https://docs.bitiful.com/en/coreix/handbook/origin-protect.md) and set the default style to `detail`. Visitors can access files only through styles and can't get the originals.

### Sign access to private content

Keep direct message images and private albums in a separate directory (for example, `private/`) and keep it private. When a user views them, your backend issues a [presigned link](https://docs.bitiful.com/en/developer/s3/presigned-url.md) with a short validity period. These links can include a style too.

### Deliver through the CDN

Bind a [CDN domain](https://docs.bitiful.com/en/cdn/handbook/domains.md) and use [edge rules](https://docs.bitiful.com/en/cdn/handbook/rules.md) to:

- Allow only your own websites and apps to embed images ([Referer hotlink protection](https://docs.bitiful.com/en/cdn/handbook/access-control.md); allow empty Referers as needed for app compatibility);
- Require an [advanced authentication](https://docs.bitiful.com/en/best-practice/token-link.md) signature on the `private/` path;
- Block known bulk download tools.

### Watch trending content

In [Top content](https://docs.bitiful.com/en/console/popular.md), check **URL path** and **Referring site** by traffic to catch hotlinked or suddenly viral content early.

## Key practices

### Keep feeds from jumping

When a post is published, call `fmt=thumbhash` (or `blurhash`) once and store the resulting short string in your database along with the image's width and height. When rendering the feed, use the [placeholder](https://docs.bitiful.com/en/bitiful-s4/features/hash-placeholder.md) to reserve the space first, then load the real `!style:feed` image, so the list never jumps as images load.

### One original for every screen

You don't need to generate several thumbnails at upload time. To add a new display location, just add a style. On high-density screens, use the `dpr` parameter to output 2x images. The CDN caches every size, so each size is processed only once.

### Protect privacy

- For publicly displayed images, such as street photography or event photos, you can add [face blurring](https://docs.bitiful.com/en/coreix/features/face-privacy.md) to the style;
- Serve only processed images publicly. CoreIX strips unnecessary metadata such as Exif;
- Don't make private content publicly readable. Access it only through signed links with a short validity period.

### Catch duplicates and spam

When a post is published, compute `fmt=phash` and compare it with recent hashes from the same user or across the site. Treat images with a very small Hamming distance as duplicates, and merge or throttle them.

## Cost tips

- Use `fmt=auto` and a suitable `q` for avatars and feed images. They're usually far smaller than the originals;
- Popular content is concentrated, so the CDN cache hit ratio is high and origin fetches and processing are few;
- Hotlinking is a common cause of unusual traffic in community products. Turning on hotlink protection avoids those charges directly.

## Launch checklist

- [ ] Clients contain no keys, and all uploads use presigned links with a short validity period and a request limit
- [ ] Every display location has a matching style, and original file protection is on
- [ ] Private content directories stay private, and views use short-lived links
- [ ] The CDN domain has Referer hotlink protection and authentication on private directories
- [ ] Feeds use placeholders
- [ ] You check the referring sites in Top content regularly

## Related docs

- [Upload files securely from the client](https://docs.bitiful.com/en/best-practice/web-uploads.md)
- [Image hash placeholders](https://docs.bitiful.com/en/bitiful-s4/features/hash-placeholder.md)
- [Face blurring](https://docs.bitiful.com/en/coreix/features/face-privacy.md)
- [Hotlink protection and access control](https://docs.bitiful.com/en/cdn/handbook/access-control.md)
- [Top content](https://docs.bitiful.com/en/console/popular.md)
