Skip to main content
nadjac1030
Participating Frequently
April 14, 2023
Answered

Remove shadows from different kind of objects

  • April 14, 2023
  • 3 replies
  • 4534 views

Hi folks! Is there a way to remove shadows from many different objects at once? (It’s a map, all countries with various colors and lines). 

This topic has been closed for replies.
Correct answer m1b

Just for the sake of exploring options, here is another approach to removing the shadows. The downside is that it removes any raster items from the document (because expanded shadows are raster items), and doubles the paths into filled paths and stroked paths (instead of previously being both filled and stroked).

var doc = app.activeDocument,
    items = doc.rasterItems;

app.executeMenuCommand('selectall');
app.executeMenuCommand('expandStyle');
app.executeMenuCommand('deselectall');

for (var i = items.length - 1; i >= 0; i--)
    items[i].remove();

If you want to test this script, save it as a plain text file with name, eg. "Expand appearance and remove shadows.js" and run from the File > Scripts > Other Script ... menu.

- Mark

3 replies

m1b
m1bCorrect answer
Community Expert
April 14, 2023

Just for the sake of exploring options, here is another approach to removing the shadows. The downside is that it removes any raster items from the document (because expanded shadows are raster items), and doubles the paths into filled paths and stroked paths (instead of previously being both filled and stroked).

var doc = app.activeDocument,
    items = doc.rasterItems;

app.executeMenuCommand('selectall');
app.executeMenuCommand('expandStyle');
app.executeMenuCommand('deselectall');

for (var i = items.length - 1; i >= 0; i--)
    items[i].remove();

If you want to test this script, save it as a plain text file with name, eg. "Expand appearance and remove shadows.js" and run from the File > Scripts > Other Script ... menu.

- Mark

nadjac1030
Participating Frequently
April 15, 2023
Dear Mark,
Oh wow – i really have to try this – thanks a lot for your recommendation! I am deeply grateful now having several opportunities to solve this.

Best regards, Nadja
m1b
Community Expert
April 14, 2023

Hi @nadjac1030, would you mind posting a small section of a file for us to inspect? It will make things much easier. Unfortunately what you want is made difficult because we don't have access to shadows via scripting. But still worth looking into. If you post a sample file, please save it as .pdf because the forum software doesn't accept .ai files. - Mark

nadjac1030
Participating Frequently
April 14, 2023

Hi there, thanks for your support – enclosed you’ll find the map i am talking about.

nadjac1030
Participating Frequently
April 14, 2023

After unlocking all layers/objects and selecting all, the Reduce to Basic Appearance command in the Appearance panel flyout menu seems to work well in your sample file.

 

Are you sure that you are not confusing it with the Clear Appearance command?

 


I tried that but still some parts of the map will not react to this. For instance: Panama / Venezuela. And some parts will vanish (Look at Greece > there is a blank spot in between after reducing to basic appearance. But yes, for most parts of the map it works fine (yet it’s not "safe" to convert). Thanks for your help!

Jacob Bugge
Community Expert
April 14, 2023

Nadja,

 

If the shadows are the only thing that has been done to simple paths with fills and/or strokes, you can try this on a copy of the artwork (always keep a backup of artwork before you do something destructive):

 

1) Select everything,

2) In the Appearance panel reduce to basic appearance.

 

nadjac1030
Participating Frequently
April 14, 2023

This won’t work – the illustration is very complex – some objects have lines, some not, they are filled with different colors, some are grouped, some not. If i select them all it just says mixed appearence. Basic appearance doesn’t help because many objects will change. Some even vanish.

 

m1b
Community Expert
April 14, 2023

When I tested with your document, I did see some things vanish, eg. small islands. But the reason was simply because the shadows were removed from behind them and they were white on white background. I don't see how any technique could resolve that without changing the stroke settings.