Abstract
In this work, we present a new framework for the stylization of text-based binary images. First, our method stylizes the stroke-based geometric shape like text, symbols and icons in the target binary image based on an input style image. Second, the composition of the stylized geometric shape and a background image is explored. To accomplish the task, we propose legibility-preserving structure and texture transfer algorithms, which progressively narrow the visual differences between the binary image and the style image. The stylization is then followed by a context-aware layout design algorithm, where cues for both seamlessness and aesthetics are employed to determine the optimal layout of the shape in the background. Given the layout, the binary image is seamlessly embedded into the background by texture synthesis under a context-aware boundary constraint. According to the contents of binary images, our method can be applied to many fields. We show that the proposed method is capable of addressing the unsupervised text stylization problem and is superior to state-of-the-art style transfer methods in automatic artistic typography creation. Besides, extensive experiments on various tasks, such as visual-textual presentation synthesis, icon/symbol rendering and structure-guided image inpainting, demonstrate the effectiveness of the proposed method.
Introduction
Traditional style transfer methods, such as Neural Style Transfer, often struggle with text-based binary images. These images lack the high-level semantic information found in natural photos, and there is a massive "modality discrepancy" between a flat, black-and-white shape and a complex, colorful style image, such as a photo of fire or clouds.
Existing text-specific stylization methods usually follow a supervised approach, requiring specific examples of plain text and their stylized versions to learn the transformation. In real-world scenarios, these pairs are rarely available. This research introduces an unsupervised framework for stylizing binary shapes—like text, icons, and symbols—using arbitrary style images and then automatically embedding them into background scenes. The goal is to take a plain word like "FIRE" and a single photo of a flame, and produce a result where the letters look like they are actually made of fire while remaining perfectly readable.
Methodology
The proposed multi-stage pipeline is divided into two main subtasks: Style Transfer and Layout Design. By combining structure transfer with context-aware layout optimization, the system creates professional-looking artistic typography without requiring paired training data.
Style Transfer
- Guidance Map Extraction: To bridge the gap between the binary shape and the style image, the system extracts a "guidance map" from the style image. It uses Relative Total Variation (RTV) to smooth out textures followed by superpixel clustering to find the core structural contours of the style.
- Legibility-Preserving Structure Transfer: Using a modified Layered Shape Synthesis (LSS) algorithm, the system deforms the edges of the text to match the style's contours. Crucially, it uses a stroke trunk protection mechanism that keeps the central "skeleton" of the letters intact while only allowing the ends and edges to morph, ensuring the text remains readable.
- Texture Transfer: The system uses patch-based synthesis to apply the style's texture. A saliency constraint encourages the foreground of the text to use the most visually interesting parts of the style image while keeping the background clean.
Context-Aware Layout Design
- Position Estimation: The system automatically finds the optimal placement for the text in a background image. It optimizes a cost function based on four factors: finding flat regions (low variance), avoiding important objects (saliency), matching the background's texture (coherence), and centering the composition (aesthetics).
- Shape Embedding: Finally, the stylized shape is blended into the background using image inpainting techniques, ensuring the boundaries look seamless rather than just "pasted on."
Results and Key Insights
Because the method is unsupervised and patch-based, it does not require a massive training dataset. Evaluation was conducted using high-quality photography from Unsplash and a 20-person user study comparing the results against six state-of-the-art methods (including Neural Style, CNNMRF, and Image Analogies).
Key Insights
- The "Trunk" Matters: Legibility in text stylization is primarily tied to the "trunk" of the stroke. By protecting the skeleton and only deforming the edges, the system achieves extreme stylization without losing readability.
- Bridging the Modality Gap: Instead of mapping pixels directly, the authors create an intermediate "abstract imagery" (the guidance map) that both the binary shape and the style image can relate to.
- Contextual Integration: Stylization is integrated with the background by adjusting the text's scale, rotation, and color to match the specific scene, creating a cohesive piece of art.
Performance
In the user study, the proposed method received an average score of 6.54/7.0, significantly higher than the next best method (Image Analogies at 4.51). The system demonstrated robustness across diverse languages (English, Chinese, Thai, Russian, Arabic, Korean) and various fonts. While texture transfer takes approximately 272 seconds for a 1.5Mp image, the overall complexity is $O(N \log N)$, making it practical for design applications.
Conclusion
While effective, the current guidance map extraction relies on basic color features; future work could incorporate deep features from neural networks to improve results for complex semantic scenes. Additionally, the method may struggle with very dense patterns in the source style. Future developments could also include automatic style selection based on the semantic relevance of the background (e.g., suggesting "cloud" styles for a sky background).
Summary updated