Rendering Engines - matthewnau/libmoji GitHub Wiki
Rendering Engines
Bitmoji is a large and complex service which employs multiple APIs in an effort to render images to the end user. Libmoji tries to make it possible to access these APIs in every way possible. It appears that different rendering engines are used for different components of the Bitmoji platform. The engines will be known respectively as the preview
, cpanel
, and render
engines. This article will explore in depth the capabilities and limitations associated with each in an effort to provide you with enough information to successfully utilize Libmoji.
The Preview Engine
The preview engine is used for displaying what the user's avatar will look like before it is saved to Bitmoji's database. This allows the user to mix and match combinations of physical traits, outfits, and accessories. All preview images start with the base URL of https://preview.bitmoji.com/avatar-builder-v3/preview/
. The preview engine allows for customization of all aspects of a Bitmoji. Read this article to understand what elements comprise preview image URLs.
The preview engine has the ability to render many aspects of an avatar, but it does not allow for the use of comics. Comics are the part of Bitmoji that consumers use on a daily basis. Unfortunately, in order to utilize the comics feature an account must be held with either Bitmoji or Snapchat.
The Cpanel Engine
The cpanel engine is one of the 2 engines used for rendering what Bitmoji comics should look like. Of the 2, the cpanel engine offers the least amount of customization and offers no known benefits over the alternative. Despite its lackluster feature count, I still chose to include the functionality in Libmoji so that any information I uncovered would be accessible to the public.
All cpanel URLs start with https://render.bitstrips.com/v2/cpanel/
. The cpanel engine only provides modification access for parameters such as transparent
(0 or 1), scale
(1 or 2), and allows the style of the avatar to be changed. I uncovered the additional parameter palette
, which has a default value of 1. Changing this value does not appear to do anything, and the parameter can even be omitted entirely.
The Render Engine
The render engine is probably the most customizable of all the preview engines, but how it operates is largely hidden. Bitmoji recently deprecated their online avatar editor, and only allows you to edit your personal avatar from their app. The old editors values and engine can still be accessed, but it makes it hard to find any new information on it. When viewing the traffic while building an avatar, its clear that the preview engine was meant to replace this section of the avatar-building process.
This engine provides a ton of flexibility when creating an image URL. It has a base URL of https://render.bitstrips.com/render/
. It has the same parameters as the cpanel engine, except it allows even more parameters. There is a sex
paramter with options 1or 2. (Same as the gender in Libmoji) One notable difference of this engine is the pd2
parameter. You can directly modify the physical traits of a Bitmoji on top of the comic that is being rendered. You have to supply your ID, but anything after that overrides your original Bitmoji! Here is an example of the pd2 parameter being used.
pd2={"cranium":"cranium_bm35","forehead":"forehead_bm1"}
This directly overrides the cranium
and forehead
traits of your Bitmoji. These traits are from the legacy system and do not work in the preview engine. The render engine can load Bitmoji Deluxe
avatars, but does not have access to the new traits because they have a numbering system, and not an attribute label. To find all legacy data, I have provided a legacy.json file with all traits and values that i was able to record before the editor was deprecated. Although new traits do not work with the render engine, all outfits from the templates file do appear to work.
Bitmoji colors are modified in the same way pd2 is. With the paramter colours={"ff9866":9476876}
. Every new color/key combo is separated by a comma like pd2 as well. What makes this difficult is the color labels correspond to a random trait color. Some experimentation will need to be done in order to find what ff9866
is changing the color of an etc.
Surprisingly, this isn't even all we have access to change. There is a proportion
parameter. (supply it with an integer value) This determines the face/head shape. One of the most useful parameters is cropped
. Modifiying this value can render a Bitmoji in the pose of a specific comic, but without the actual comic-related images! When using the render engine, all comic features are cropped out by default, but whitespace is still left in its place. To render comics, you will unfortunately have to use the cpanel engine. You can specify cropped
to head
or body
to remove whitespace. Look at the example of the cpanel vs the render engine below.
The cpanel and render engines sometimes can prove unpredictable, so if you don't need comic functionality, it may be best to stick with the preview engine. If you need avatar control, go with the preview engine. If you need comics, use cpanel. And if you want to render your personal Bitmoji in different positions, use the render engine. Good luck!