Jump to content

Changing product item background fill colour


Recommended Posts


I need a sanity check on something for Prestashop 1.6

Currently the fill colour of a product is white and I need it to be black.

Doing research I went into /classes/ImageManager.php and changed the 255,255,255 at the end of the $white line to 0,0,0


			$white = imagecolorallocate($dest_image, 0, 0, 0);
			imagefilledrectangle ($dest_image, 0, 0, $dst_width, $dst_height, $white);

I also went into /webservice/WebserviceSpecificManagementImages.php and changed the 255,255,255 on the $white line to 0,0,0

if (
!($destImage = imagecreatetruecolor($destWidth, $destHeight)) ||
!($white = imagecolorallocate($destImage, 0, 0, 0)) ||

Cleared the cache on both the store site and the browser but the fill was still white
Changed the Images from JPG to all PNG but still white
Retriggered the thumbnails to be rebuilt, still white.

Have I missed something obvious?





Link to comment
Share on other sites

According to the PS code, the PNG images are filled with transparent background. If you try with PNG, you could change ImageManager from this line

            $transparent = imagecolorallocatealpha($dest_image, 255, 255, 255, 127);


            $transparent = imagecolorallocatealpha($dest_image, 0, 0, 0, 0);

Also note that the definition of $white or $transparent is done at several places in ImageManager.php. If counted 4 places.

Have you changed them all or only at one place?

Edited by Scully (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...