Skip to content

Social and communities

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

ChallengeWhat it looks like
Many upload entry pointsiOS, Android, mini programs, and websites all upload, and keys can't be shipped in the client
Many sizesThe same image appears at different sizes in avatars, feeds, detail pages, and share cards
Mixed formatsHEIC, Live Photos, HDR photos, and many video codecs
Feeds need to scroll smoothlySlow image loading and layout shifts reduce time spent in the app
PrivacyPublic content contains passersby's faces, and direct messages and private albums must not be directly accessible
Hotlinking and spikesPopular images get embedded by other websites, and traffic spikes without you knowing where it comes from

Industry examples

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:

StageCapability
ReadingRecognizes 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
ProcessingCropping, resizing, rotation, compression, format conversion, and watermarks are all applied to the HDR information too, and the output is still HDR
OutputJPEG 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)
WatermarksBoth 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
FallbackWhere HDR isn't supported, add hdr-rate=0 to map to SDR with natural color and no washed-out look
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 and Text watermarks.

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:

CapabilityDetails
SplittingApple Live Photos and Live Photos from OPPO, vivo, and iQOO can be split into a still image and a video
Conversion and mergingConvert between the Apple and Android approaches. Google, realme, Xiaomi, Huawei, and Honor formats can be used as conversion targets
HDRThe still image keeps its HDR and goes through the same processing pipeline as ordinary HDR photos
WatermarksText 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 previewsThe 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 for the supported formats, and contact support for the specific processing parameters.

What each part of Bitiful does

CapabilityWhat it does here
Presigned URLsYour 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-detectionBrowsers recognize files correctly even when the client doesn't set Content-Type properly
Conditional requestsIf-None-Match: * keeps duplicate submissions from overwriting existing files
Sub-user permissionsThe backend that issues links is granted only the uploads/ directory, which limits the damage if a key leaks
CoreIX resizing and smart croppingServes every size, including avatars, feeds, and detail pages, from one original. pos=smart keeps faces and subjects automatically
Format conversionfmt=auto outputs AVIF/WebP based on browser support, and HEIC displays correctly on web pages too
Live Photos and HDRSplits Live Photos from iOS and major Android manufacturers into a still image and a video. HDR photos stay HDR after processing
BlurHash / ThumbHashFeeds show a blurred placeholder first and swap in the image seamlessly when it arrives, with no layout shift
Video frame extractionframe=auto picks a video cover automatically, avoiding black and blurry frames
Face blurringAutomatically blurs or pixelates faces in publicly displayed images
Image analysisfmt=phash detects images posted repeatedly, and fmt=tags tags images automatically for recommendations
Styles + original file protectionAllows access only through agreed styles, so originals can't be downloaded and parameters can't be abused
CDN and edge rulesCaches popular content close to users; Referer hotlink protection, signatures for private directories, and blocking of unusual User-Agents
Top content / UsageSee which content is taking off and which websites and regions the traffic comes from

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 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.

Define styles

Define a style for each display location, and the frontend only appends the style name:

LocationStyle nameExample parameters
Avataravatarw=200&h=200&pos=smart&fmt=auto
Feedfeedw=720&fmt=auto&q=80
Large detail imagedetailw=1600&fmt=auto
Share cardsharew=1200&h=630&pos=smart&fmt=jpg
Video covercoverframe=auto&w=720&fmt=auto

Turn on original file protection

On the bucket's Media processing tab, turn on original file protection 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 with a short validity period. These links can include a style too.

Deliver through the CDN

Bind a CDN domain and use edge rules to:

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 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 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