Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(42)  |  Call(42)  |  Derive(0)  |  Import(0)

        def Draw(im, mode=None):
    try:
        return im.getdraw(mode)
    except AttributeError:
        return ImageDraw(im, mode)
        


src/m/a/MapProxy-1.6.0/mapproxy/image/message.py   MapProxy(Download)
            return ImageSource(base_img, size=size, image_opts=self.image_opts)
 
        draw = ImageDraw.Draw(base_img)
        self.draw_msg(draw, size)
        image_opts = self.image_opts

src/m/a/MapProxy-1.6.0/mapproxy/image/mask.py   MapProxy(Download)
def image_mask_from_geom(img, bbox, polygons):
    transf = make_lin_transf(bbox, (0, 0) + img.size)
 
    mask = Image.new('L', img.size, 255)
    draw = ImageDraw.Draw(mask)

src/m/a/mapproxy-HEAD/mapproxy/image/message.py   mapproxy(Download)
            return ImageSource(base_img, size=size, image_opts=self.image_opts)
 
        draw = ImageDraw.Draw(base_img)
        self.draw_msg(draw, size)
        image_opts = self.image_opts

src/m/a/mapproxy-HEAD/mapproxy/image/mask.py   mapproxy(Download)
def image_mask_from_geom(img, bbox, polygons):
    transf = make_lin_transf(bbox, (0, 0) + img.size)
 
    mask = Image.new('L', img.size, 255)
    draw = ImageDraw.Draw(mask)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_image_messages.py   MapProxy(Download)
    def test_ul(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello', font)
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_ul(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font)
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_lr(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font, placement='lr')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_center(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font, placement='cc')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_unicode(self):
        font = ImageFont.load_default()
        td = TextDraw(u'Héllö\nWørld', font, placement='cc')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_image_messages.py   mapproxy(Download)
    def test_ul(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello', font)
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_ul(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font)
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_lr(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font, placement='lr')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_multiline_center(self):
        font = ImageFont.load_default()
        td = TextDraw('Hello\nWorld', font, placement='cc')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)
    def test_unicode(self):
        font = ImageFont.load_default()
        td = TextDraw(u'Héllö\nWørld', font, placement='cc')
        img = Image.new('RGB', (100, 100))
        draw = ImageDraw.Draw(img)

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_image.py   MapProxy(Download)
        # generate RGBA images with a transparent rectangle in the lower right
        img1 = ImageSource(Image.new('RGBA', (50, 50), (0, 255, 0, 255))).as_image()
        draw = ImageDraw.Draw(img1)
        draw.rectangle((25, 25, 49, 49), fill=(0, 0, 0, 0))
        paletted_img = quantize(img1, alpha=True)
        assert img_has_transparency(paletted_img)
        assert paletted_img.mode == 'P'
 
        rgba_img = Image.new('RGBA', (50, 50), (255, 0, 0, 255))
        draw = ImageDraw.Draw(rgba_img)
 
        img1 = Image.new('RGBA', size=(100, 100), color=(255, 0, 0, 255))
        draw = ImageDraw.Draw(img1)
        draw.rectangle((33, 0, 66, 100), fill=(255, 0, 0, 128))
        draw.rectangle((67, 0, 100, 100), fill=(255, 0, 0, 0))
        img1 = ImageSource(img1)
        img2 = Image.new('RGBA', size =(100, 100), color=(0, 255, 0, 255))
        draw = ImageDraw.Draw(img2)
        bg = ImageSource(bg)
        fg = Image.new('RGBA', size =(100, 100), color=(0, 0, 0, 0))
        draw = ImageDraw.Draw(fg)
        draw.rectangle((10, 10, 89, 89), fill=(0, 255, 255, 255))
        fg = ImageSource(fg, image_opts=ImageOptions(opacity=0.5))

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_image.py   mapproxy(Download)
        # generate RGBA images with a transparent rectangle in the lower right
        img1 = ImageSource(Image.new('RGBA', (50, 50), (0, 255, 0, 255))).as_image()
        draw = ImageDraw.Draw(img1)
        draw.rectangle((25, 25, 49, 49), fill=(0, 0, 0, 0))
        paletted_img = quantize(img1, alpha=True)
        assert img_has_transparency(paletted_img)
        assert paletted_img.mode == 'P'
 
        rgba_img = Image.new('RGBA', (50, 50), (255, 0, 0, 255))
        draw = ImageDraw.Draw(rgba_img)
 
        img1 = Image.new('RGBA', size=(100, 100), color=(255, 0, 0, 255))
        draw = ImageDraw.Draw(img1)
        draw.rectangle((33, 0, 66, 100), fill=(255, 0, 0, 128))
        draw.rectangle((67, 0, 100, 100), fill=(255, 0, 0, 0))
        img1 = ImageSource(img1)
        img2 = Image.new('RGBA', size =(100, 100), color=(0, 255, 0, 255))
        draw = ImageDraw.Draw(img2)
        bg = ImageSource(bg)
        fg = Image.new('RGBA', size =(100, 100), color=(0, 0, 0, 0))
        draw = ImageDraw.Draw(fg)
        draw.rectangle((10, 10, 89, 89), fill=(0, 255, 255, 255))
        fg = ImageSource(fg, image_opts=ImageOptions(opacity=0.5))

src/m/a/mapproxy-HEAD/mapproxy/test/system/test_mixed_mode_format.py   mapproxy(Download)
    # tiles (img size = 512x256) will be fully opaque and the other 
    # has transparency
    draw = ImageDraw.Draw(img)
    w, h = size
    red_color = ImageColor.getrgb("red")

src/m/a/mapproxy-HEAD/mapproxy/test/image.py   mapproxy(Download)
    img = Image.new('RGBA', size)
    if two_colored:
        draw = ImageDraw.Draw(img)
        draw.rectangle((0, 0, img.size[0]//2, img.size[1]),
            fill=ImageColor.getrgb('white'))
        img = Image.new("RGB", size, ImageColor.getrgb("#EEE"))
 
    draw = ImageDraw.Draw(img)
    draw_pattern(draw, size)
    return img

  1 | 2  Next