Scaling by two-fold

This is a bonus section for scaling/resizing. The JuliaImages package has a very useful function called somepkg(restrict), which reduces the size of an image by two-fold along the dimensions specified. In other words, it scales the image by 50%.

restrict can be run in three ways:

Let's run a demo. Try sending 1 as an additional argument so that we decrease the height by 50%:

Consider the following code:

  using Images
source_image
= load("sample-images/cats-3061372_640.jpg");
resized_image = restrict(source_image, 1); # height
imshow(resized_image);