Canvas helper and primitives serializer