Unable to fill the color on images

I am unable to fill the color on images , do we have any way to fill the color?

@sarathepiq

Aspose.Cells does not provide a built‑in API to change the fill colour of an image that is already placed in a worksheet. The picture object only exposes positioning, size and basic formatting (border, rotation, etc.); colour manipulation must be done on the image itself before it is added to the sheet.

Typical workaround

  1. Load the source image with Aspose.Imaging (or any other image‑processing library).
  2. Apply the required colour fill / recolouring operation.
  3. Save the modified image to a stream or temporary file.
  4. Insert the resulting image into the worksheet, e.g.:
// 1. Load and recolour the image
using (var img = Aspose.Imaging.Image.Load("source.png"))
{
    // example: fill with solid colour – replace with your own logic
    var bitmap = (Aspose.Imaging.FileFormats.Png.PngImage)img;
    bitmap.BackgroundColor = Color.Red;   // or use Graphics to draw over it
    bitmap.Save("recoloured.png");
}

// 2. Insert the recoloured image into the sheet
var wb = new Aspose.Cells.Workbook();
var ws = wb.Worksheets[0];
int pictureIdx = ws.Pictures.Add(0, 0, "recoloured.png");
Aspose.Cells.Picture pic = ws.Pictures[pictureIdx];

// optional: adjust size/position
pic.Width = 100;
pic.Height = 100;

wb.Save("output.xlsx");

If you need to change the colour of vector images (e.g., SVG), the same approach applies: load the SVG with Aspose.Imaging, modify the Fill/Stroke attributes, then insert the updated SVG.

What we need to investigate further (if the above does not solve your case)

  • Exact Aspose.Cells version you are using.
  • Sample code that shows how the image is currently added to the worksheet.
  • A small test file (input image + expected output) so we can reproduce the issue.

Provide those details and we can confirm the behaviour or suggest a more specific fix.

@sarathepiq,

It appears you are utilizing the Aspose.Cells.GridJs control. Kindly note that we have introduced support for fill color settings for charts (Ticket ID: “CELLSGRIDJS-1930”) in version 25.11. However, the support for fill color in images has not yet been implemented. Could you please share your input Excel file containing the image(s) along with your expected output? This will help us understand your requirements for applying fill color to images or shapes. We will log the appropriate ticket and try to address it.

Please find the attached file that contains images.
Images, icons and formulae 1 (2).zip (1.5 MB)

@sarathepiq
can you show us what is the expected effect you want to apply.

@sarathepiq
we can see some shapes/images can be filled with color .


but the two images left can not apply the color effect.

@sarathepiq
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-2135
Support fill color settings for images/shapes

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.