I want to reduce the size of an image using Python
import numpy as np
from skimage import io
img = io.imread('img.jpg')
smallImg = img[::2, ::2]
gives me image which 50 percent of the original because the step size of the slice is 2. How can i make it to be let's say 90 percent of original one?
Regular python slice did not help me. It seems that i don't know how to slice a list, so it will return me for example, 2nd, 3rd, 5th, 7th etc. elements. Let's say i have something like:
arr = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
arr[::2]
Running the code above gives me:
array([1, 3, 5, 7, 9])
However, i want opposite to this result:
array([2, 3, 5, 6, 8, 9])