output images become smaller than the original ones

Hello Photoroom Support Team,

We are experiencing an issue with image sizes when using the Background Removal API, and we can’t find a clear pattern so far.

In some cases, the output images become smaller than the original ones, even though we are not explicitly using any size parameter that should affect the dimensions.

For background removal, we are using the following endpoint:
https://sdk.photoroom.com/v1/segment

Important details:
• We do not set the size parameter intentionally.
• We do not expect any resizing, but sometimes the resulting image dimensions are smaller than the input image.
• The behavior is inconsistent.

Thank you in advance.

Hi @dmitry3dsellers ,

Would be happy to run some tests for you. Are you able to attach some input images that are getting resized? Also, are you passing an API parameters or just the image_file?

Hey!

Yes, we only use image_file, sometimes adding format if it’s available, and last week we added bg_color. I don’t think the image is the main problem; it happens randomly. But you can use this one

form.append(‘image_file’, imageBuffer, ‘image.jpg’);

if (format) {
form.append(‘format’, format);
}

form.append(‘bg_color’, ‘#ffffff’);