Resize the image to `size`, size can be a single int.
496362
def resize(self, size:Union[int,TensorImageSize]) -> 'ImagePoints':
        ""
        if isinstance(size, int): size=(1, size, size)
        self._flow.size = size[1:]
        return self
793804
function resizeImage(img, max_width, max_height) {
    var sizes = this.getImageNewAspectSizes(img, max_width, max_height);
    var width = sizes.width;
    var height = sizes.height;
    var canvas = this.imageToCanvas(img, width, height);
    return canvas;
    //return this.getImageByCanvas(canvas);
  }
1230476
def set_size(self, size):
        
        raise NotImplementedError("%s not implemented for %s" % (self.set_size.__func__.__name__,
                                                                 self.__class__.__name__))
1099430
def resized(*args, **kwargs):
    
    resized_image = None
    try:
        resized_image = resize(*args, **kwargs)
        yield resized_image
    finally:
        if resized_image is not None:
            resized_image.close()
416258
def resize_image(image_str_tensor):
  """"""

  image = decode_and_resize(image_str_tensor)
  image = tf.image.encode_jpeg(image, quality=100)
  return image
990699
def resize_image(self, data, size):
        
        from machina.core.compat import PILImage as Image
        image = Image.open(BytesIO(data))

        # Resize!
        image.thumbnail(size, Image.ANTIALIAS)

        string = BytesIO()
        image.save(string, format='PNG')
        return string.getvalue()
45984
def resize(img, width, height):
    
    return img.resize((width, height), Image.ANTIALIAS)
792430
def crop_resize_image(image: np.ndarray, size) -> np.ndarray:
    
    width, height = image.size
    if width > height:
        left = (width - height) / 2
        right = width - left
        top = 0
        bottom = height
    else:
        top = (height - width) / 2
        bottom = height - top
        left = 0
        right = width
    image = image.crop((left, top, right, bottom))
    image = image.resize(size, Image.ANTIALIAS)
    return image
1128695
def set_size(self, size):
        
        if not isinstance(size, baseinteger):
            raise TypeError("size can only be an instance of type baseinteger")
        self._call("setSize",
                     in_p=[size])
437593
def resize_compute_width_height(fullfile,_megapixels):
    """"""

    img = Image.open(fullfile)
    width,height=img.size

    current_megapixels=width*height/(2.0**20)
    scale=sqrt(_megapixels/float(current_megapixels))

    logger.debug('A resize scale would be %f'%(scale))
    # Can't make bigger, return original
    if scale>= 1.0:
        logger.warning('Image is %0.1f MP, trying to scale to %0.1f MP - just using original!',
                current_megapixels,_megapixels);
        return width,height

    new_width=int(width*scale)
    new_height=int(height*scale)

    return new_width,new_height
1360304
public static Image scale(Image srcImage, int width, int height, Color fixedColor) {
		return Img.from(srcImage).scale(width, height, fixedColor).getImg();
	}
303406
def _resize(self, width, height):
        '''
        
        '''
        self._dirty_size = width, height
        self.reset_canvas(width, height)
        self.draw()
        self._dirty_draw = True
901786
def resize(self, size):
		
		if size < len(self):
			raise ValueError("Value is out of bound. Array can't be shrinked")
		current_size = self.__size
		for i in range(size - current_size):
			self.__array.append(WBinArray(0, self.__class__.byte_size))
		self.__size = size
133182
def resize_bytes(self, size):
        
        self._nbytes = size
        self._glir.command('SIZE', self._id, size)
        # Invalidate any view on this buffer
        for view in self._views:
            if view() is not None:
                view()._valid = False
        self._views = []
386184
def process(image, size, *args, **kwargs):
        
        from autodetect import smart_crop
        box_width, box_height = AutoCrop.parse_size(image, size)
        scaled_size, rect = smart_crop(box_width, box_height, image.filename)
        return image.resize(scaled_size, Image.ANTIALIAS).crop(tuple(rect))
1232945
def on_size(self, event):
        ''''''
        state = self.state
        self.need_redraw = True
        if state.report_size_changes:
            # tell owner the new size
            size = self.frame.GetSize()
            if size != self.last_size:
                self.last_size = size
                state.out_queue.put(MPImageNewSize(size))
544723
def resize(self):
        
        resized_size = self.get_resized_size()
        if not resized_size:
            return

        self.image = self.image.resize(resized_size, Image.ANTIALIAS)