color changes when removing background v1 api

we use the api to remove background on pictures. we are very happy with it, but these pictures, change color when we do it. is there something special in the picture that makes this happen?



Hi there,

Thank you for flagging this!

Could you please share the code params used to make the call?

$postData = ([
‘image_file’ => new CURLFile($imagePath),
‘format’ => ‘jpg’,
‘bg_color’ => ‘#ffffff’,
‘crop’ => ‘true’
]);
//$data = $this->buildMultipartFormData($postData, $boundary);
$data = $postData;
$headers = [
//‘Accept: image/jpeg, application/json’,
//‘Content-Type: multipart/form-data; boundary=’ . $boundary,
'x-api-key: ******
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://sdk.photoroom.com/v1/segment”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_ENCODING, “”);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POSTFIELDS, ($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)’);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

Hi @kids-world , thanks for sharing this. I wasn’t able to reproduce, however am curious if this is happening for you consistently?

I’ll continue to investigate on my end.

yep. it happens evry time we use this image. we have had it do it on a few other ones aswell.

Thanks for confirming - we are looking into this issue for you!

if you have an email, i will send 3 original photos for yopu to test with. all 3 has the same issue

It would be great to have the exact files that are causing the issue. I’ve shared my email in DM’s if that’s easiest to share?

anything new on this??

also see this:

Hi @kids-world ,

It looks like your input image has a custom colorspace profile.

We only support sRGB on our end: https://docs.photoroom.com/getting-started/frequently-asked-questions#q-which-colorspaces-are-supported

I would recommend that you convert to sRGB before doing the API call.

Let me know if this helps?