--- # Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. title: Vector Graphics description: | How to draw simple images using vector images, instead of bitmaps. guide_group: graphics-and-animations order: 3 platform_choice: true related_docs: - Draw Commands related_examples: - title: PDC Image url: https://github.com/pebble-examples/pdc-image - title: PDC Sequence url: https://github.com/pebble-examples/pdc-sequence --- This is an overview of drawing vector images using Pebble Draw Command files. See the [*Vector Animations*](/tutorials/advanced/vector-animations) tutorial for more information. ## Vector Graphics on Pebble As opposed to bitmaps which contain data for every pixel to be drawn, a vector file contains only instructions about points contained in the image and how to draw lines connecting them up. Instructions such as fill color, stroke color, and stroke width are also included. Vector images on Pebble are implemented using the ``Draw Commands`` API, which allows apps to load and display PDC (Pebble Draw Command) images and sequences that contain sets of these instructions. An example is the weather icon used in weather timeline pins. The benefit of using vector graphics for this icon is that is allows the image to stretch in the familiar manner as it moves between the timeline view and the pin detail view:  The main benefits of vectors over bitmaps for simple images and icons are: * Smaller resource size - instructions for joining points are less memory expensive than per-pixel bitmap data. * Flexible rendering - vector images can be rendered as intended, or manipulated at runtime to move the individual points around. This allows icons to appear more organic and life-like than static PNG images. Scaling and distortion is also made possible. However, there are also some drawbacks to choosing vector images in certain cases: * Vector files require more specialized tools to create than bitmaps, and so are harder to produce. * Complicated vector files may take more time to render than if they were simply drawn per-pixel as a bitmap, depending on the drawing implementation. ## Creating Compatible Files The file format of vector image files on Pebble is the PDC (Pebble Draw Command) format, which includes all the instructions necessary to allow drawing of vectors. These files are created from compatible SVG (Scalar Vector Graphics) files. Read {% guide_link app-resources/converting-svg-to-pdc %} for more information.