from PIL import Image
from PIL import ImageDraw


class FishImageDraw(ImageDraw.ImageDraw):

    def fish(self, xy, fill):
        x, y, w, d = xy
        bc, ec, tc = fill
        bl = x + w / 4
        br = x + w * 3 / 4
        bt = y + d / 4
        bb = y + d * 3 / 4
        self.ellipse([bl, bt, br, bb], fill=bc)
        tl = x
        tr = x + w / 4
        tt = y + d / 2
        tb = y + d * 3 / 4
        self.polygon([(tl, tt), (tl, tb), (tr, y + d / 2)], fill=tc)
        fl = x + w / 4
        fr = x + w / 2
        ft = y + d / 2
        fb = y + d * 3 / 4
        self.rectangle([fl, ft, fr, fb], fill=tc)
        ecx = x + w * 3 / 4
        ecy = y + d / 2
        er = w / 8
        self.ellipse([ecx - er, ecy - er, ecx + er, ecy + er], fill=ec)
img = Image.new('RGB', (200, 200), '#000000')
drw = FishImageDraw(img)
drw.fish((10, 80, 140, 40), ('#ffffff', '#999999', '#666666'))
img.save('result.png')
