Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So, the approach suggested by @berak somehow works.

# If you take a point in the original 4K image, say:
POINT = (447, 63) # take a point in the coordinate plane xy 

# and you have the resizing factor of
RESIZE_FACTOR = 0.3 # make it this smaller

# and you want to map it in the resized image, then you can do the following:
lpoint = list(POINT) # convert the tuple to list
scaled_point = (round(lpoint[0]*RESIZE_FACTOR), round(lpoint[1]*RESIZE_FACTOR))

which prints:

(134, 19) and that is more or less the scaled version of the original point (447,63) by 0.3, which was the resizing factor.

So, the approach suggested by @berak somehow works.

# If you take a point in the original 4K image, say:
POINT = (447, 63) # take a point in the coordinate plane xy 

# and you have the resizing factor of
RESIZE_FACTOR = 0.3 # make it this smaller

# and you want to map it in the resized image, then you can do the following:
lpoint = list(POINT) # convert the tuple to list
scaled_point = (round(lpoint[0]*RESIZE_FACTOR), round(lpoint[1]*RESIZE_FACTOR))
round(lpoint[1]*RESIZE_FACTOR)) 
print(scaled_point)

which prints:

(134, 19) and that is more or less the scaled version of the original point (447,63) by 0.3, which was the resizing factor.

So, the approach suggested by @berak somehow works.

# If you take a point in the original 4K image, say:
POINT = (447, 63) # take a point in the coordinate plane xy 

# and you have the resizing factor of
RESIZE_FACTOR = 0.3 # make it this smaller

# and you want to map it in the resized image, then you can do the following:
lpoint = list(POINT) # convert the tuple to list
scaled_point = (round(lpoint[0]*RESIZE_FACTOR), round(lpoint[1]*RESIZE_FACTOR)) 
print(scaled_point)

which prints:

(134, 19) and that is more or less the scaled version of the original point (447,63) (447,63) by 0.3, 0.3, which was the resizing factor.

So, the approach suggested by @berak somehow works.

# If you take a point in the original 4K image, say:
POINT = (447, 63) # take a point in the coordinate plane xy 

# and you have the resizing factor of
RESIZE_FACTOR = 0.3 # make it this smaller

# and you want to map it in the resized image, then you can do the following:
lpoint = list(POINT) # convert the tuple to list
scaled_point = (round(lpoint[0]*RESIZE_FACTOR), round(lpoint[1]*RESIZE_FACTOR)) 
print(scaled_point)

which prints:

(134, 19) and that is more or less the scaled version of the original point (447,63) by 0.3, which was the resizing factor.factor. I say more or less, because we are using the function `round()' which may cause some loss depending on the case. But in general, this works.

So, the approach suggested by @berak somehow works.

# If you take a point in the original 4K image, say:
POINT = (447, 63) # take a point in the coordinate plane xy 

# and you have the resizing factor of
RESIZE_FACTOR = 0.3 # make it this smaller

# and you want to map it in the resized image, then you can do the following:
lpoint = list(POINT) # convert the tuple to list
scaled_point = (round(lpoint[0]*RESIZE_FACTOR), round(lpoint[1]*RESIZE_FACTOR)) 
print(scaled_point)

which prints:

(134, 19) and that is more or less the scaled version of the original point (447,63) by 0.3, which was the resizing factor. I say more or less, because we are using the function `round()' round() which may cause some loss depending on the case. But in general, this works.