def set_resolution(self, resolution=None):
        """
        Add physical pixel dimensions

        `resolution` supposed two be tuple of two parameterts: pixels per unit
        and unit type; unit type may be omitted
        pixels per unit could be simple integer or tuple of (ppu_x, ppu_y)
        Also possible to use all three parameters im row

        * resolution = ((1, 4), )  # wide pixels (4:1) without unit specifier
        * resolution = (300, 'inch')  # 300dpi in both dimensions
        * resolution = (4, 1, 0)  # tall pixels (1:4) without unit specifier
        """
        if resolution is None:
            self.resolution = None
            return
        # All in row
        if len(resolution) == 3:
            resolution = ((resolution[0], resolution[1]), resolution[2])
        # Ensure length and convert all false to 0 (no unit)
        if len(resolution) == 1 or not resolution[1]:
            resolution = (resolution[0], 0)
        # Single dimension
        if isinstance(resolution[0], float) or isinteger(resolution[0]):
            resolution = ((resolution[0], resolution[0]), resolution[1])
        # Unit conversion
        if resolution[1] in (1, 'm', 'meter'):
            resolution = (resolution[0], 1)
        elif resolution[1] in ('i', 'in', 'inch'):
            resolution = ((int(resolution[0][0] / 0.0254 + 0.5),
                int(resolution[0][1] / 0.0254 + 0.5)), 1)
        elif resolution[1] in ('cm', 'centimeter'):
            resolution = ((resolution[0][0] * 100,
                     resolution[0][1] * 100), 1)
        self.resolution = resolution
Add physical pixel dimensions

        `resolution` supposed two be tuple of two parameterts: pixels per unit
        and unit type; unit type may be omitted
        pixels per unit could be simple integer or tuple of (ppu_x, ppu_y)
        Also possible to use all three parameters im row

        * resolution = ((1, 4), )  # wide pixels (4:1) without unit specifier
        * resolution = (300, 'inch')  # 300dpi in both dimensions
        * resolution = (4, 1, 0)  # tall pixels (1:4) without unit specifier