blending modes in AI/PDF files not imported

Bug #410846 reported by -DD-
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Wishlist
Unassigned
inkscape (Debian)
Confirmed
Unknown

Bug Description

I'm having problems regarding the conversion from .ai file to .svg file.
The problem is an alteration of the image.
If I open files created with Adobe does not appear to be no problem, but if the file is opened by Inkscape the image is altered.

here is the original : http://img4.imageshack.us/img4/9813/originalea.jpg

I attached the original .ai file (done with illustrator 14) and the converted one with inkscape.

Revision history for this message
-DD- (mariniivan) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Confirmed with Inkscape 0.46+devel r22011 on OS X 10.5.8

I get the same result if I convert the file 'test.ai' to PDF (using OS X Preview.app) and open the resulting pdf file (attached) with Inkscape. Already the preview in the PDF import dialog shows the wrong rendering of the gradients.

Issue seems to be with the internal extension plugin for poppler in 'src/extension/internal/pdfinput', where I found the definitions for 'org.inkscape.input.ai' and 'org.inkscape.input.pdf' (pdf-input.cpp: Native PDF import using libpoppler).

tags: added: extensions-plugins importing pdf
Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

possibly duplicate of bug #251655 “Wrong gradient colors in PDF import”

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

The transparency effects in Illustrator have been achieved via masks or blending modes since (iirc) Adobe Illustrator 9.
The new AI CS4 supports transparency in gradients but previous versions didn't so it is possible that the file you're using as example was created using that previous techniques. What is visible there is either a mask or a black and white gradient that should be blended with the multiply or screen modes in illustrator.
You can try moving those elements to a new layer and use the screen or multiply blending modes, according if they are highlights or shadows (in your example they look like highlights).

Unfortunately, Inkscape had some problems with the support of blending modes on individual elements, so that feature was moved as a layer effect, exclusively (at least in the UI, I guess you can ).
With this limitation I guess that it's not possible to just "fix" the importer to support that Illustrator features.
In fact, I think it would make more sense if Adobe fixes their ugly SVG exporter making those new features (gradient transprency) available in their SVG output, since SVG supports it.

Revision history for this message
Pablo Trabajos (pajarico) wrote :

I agree with the explanation that Guillermo gave. The highlights had been created with the screen overlay method.
However,
> In fact, I think it would make more sense if Adobe fixes their ugly SVG exporter making those new features (gradient transprency) available in their SVG output, since SVG supports it.
 I don't agree with you on this. Illustrator CS4 creates a (almost) perfectly valid SVGZ, with gradients with real transparency (I did it). But you have to turn those gradients made with overlays to gradients with transparency. Illustrator won't do this for you because the file is using the old method and there is no other solution than converting them manually.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

Pablo: I asked a friend of mine who has the new Illustrator CS4 to export a svg with transparency right after my previous reply because I wasn't sure about the state of the exporter.
The file my friend sent me imported fine, so I guess I spoke too early. :-)

Anyway, this bug report is almost invalid. The previous versions of Illustrator created a file with features unsupported by Inkscape but the new version has a method that is compatible, at least when using SVG format as output.
I didn't try importing a pdf file with the new transparency from AI CS4. If it's imported correctly I think we can mark this bug invalid, since the current version of AI doesn't have the problem described. I'll check that out.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

Just checked, and a file with transparencies from AI CS4 opens fine in Inkscape. The resulting gradient isn't editable but the appearance is preserved.

Closing this bug as invalid.

Changed in inkscape:
status: Confirmed → Invalid
Revision history for this message
-DD- (mariniivan) wrote :

Thank you for the reply , can i ask so what i have to do to move the .ai to Inkscape without losing the effects .

I'm using inkscape 0.46.
Would be a huge help coz atm i'm stuck with a job .

Thank you
Regards
Ivan

Revision history for this message
-DD- (mariniivan) wrote :

I tried again with the sample i atttached but still getting wrong effects when importing to Inkscape, so i think i'm soing wrong something.

Thank you
Ivan

Revision history for this message
Pablo Trabajos (pajarico) wrote :

You're not doing anything wrong :) The problem is as follows: the .ai file has some effects that were created by using special blend modes:
* Screen: for the highlights in the face.
* Multiply: for the dark parts of the jacket's lapel.
The author of this file did it this way for an unknown reason, I speculate that it was made that way because versions older than CS4 don't have support for gradients with transparency.

On the Inkscape side the problem is:
The PDF importer (which is the same as the AI importer) seems to correctly read the file, however Inkscape itself doesn't have support for objects with blending effects such as Screen or Multiply applied to them. This is a limitation of Inkscape which has problems rendering these effects on objects (correct me if I'm wrong) and you see those ugly blackish shapes. It can render them when applied to layers.

There are several workarounds:
1- Import the files to Inkscape and convert manually all the ugly black gradients to normal gradients (with many files it can get very boring, I know...)
2- Move the affected objects to a layer and set the Blend mode to Screen (lighten) or Multiply (darken).
3- Open the AI file and export it as PDF with flattened effects. I tested this method using the PDF-X3 profile and is the fastest if you're in a hurry. A couple of caveats: after flattening the file size increases a bit. Your attached file of 288 KB was blown up to 1.293 KB. I'm pretty confident that this size could be lowered down with some settings tweaking. The blended objects get converted to bitmaps which means that if you plan to upscale this too much pixelation will be visible.

If you have many files and don't have Illustrator I can convert the files with method 3 (supposing it has a batch conversion feature).

Revision history for this message
Pablo Trabajos (pajarico) wrote :

This is the file exported from Illustrator CS4 with flattened blended objects. It imports correctly into Inkscape, however if you plan to edit it further it might be not the best way (I'm having problems editing the clipped bitmaps for some reason).

Revision history for this message
Pablo Trabajos (pajarico) wrote :

I tried to make something with method 2 and is not as easy as I thought. The imported artwork suffers from the too-many-group-inside-a-group-inside-a-group-inside-a-group syndrome that plagues imported PDFs with effects on them. There are also a lot of clipping paths that I think are not needed.

Revision history for this message
-DD- (mariniivan) wrote :

Thank you for your effort Pablo and sorry for the late answer , i'm gonna try the third method u said and i hope will work.

Thank you again

Ivan

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

Re-opened the report, confirmed it and changed it to wishlist.
Technically it isn't a bug, but a missing feature (per-object blending modes support).

Changed in inkscape:
importance: Undecided → Wishlist
status: Invalid → Triaged
su_v (suv-lp)
tags: added: filters-svg
removed: extensions-plugins
summary: - Conversion from .ai to .svg issue
+ blending modes in AI/PDF files not imported
Changed in inkscape (Debian):
status: Unknown → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.