osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Image had more that 256 colors when exporting to GIF #1994

Closed jjhugues closed 3 years ago

jjhugues commented 5 years ago

Hi,

Using OSATE2.5.2.

I made a basic AADL model, changing the colors of some blocks. When exporting the diagram to GIF, I get an error message indicating there are more than 256 colors in the diagram. I used only colors from the palette, and have just three (black, red, blue).

Work-around seems to export to BMP, but this is not satisfactory given the size increase.

philip-alldredge commented 5 years ago

Can you provide an example that allows us to reproduce the issue? What OS are you running? It is possible the limitation is platform specific. I was not able to reproduce it under Windows 10.

Practically, I doubt it would be feasible to resolve the issue in the short-term. The export diagram functionality isn't implemented by the GE.

A workaround would be to use PNG unless there is some reason you really need GIF. PNG is lossless, doesn't have the 256 color restriction, and will usually result in smaller file sizes.

jjhugues commented 5 years ago

I am using macOS, so that might be platform specific I agree that using PNG is OK, probably one can change the order in the dropdown menu to have PNG first, I picked GIF as it was the one after BMP.

A mention in the doc could be enough + a better error message that indicates it is platform-specific + the work around could be all I need for this issue

The exact error message is

Cannot save image: java.lang.IllegalStateException: Image contains more than 256 colors. Automated color reduction is currently not supported

Looks like a limit in Graphiti (not sure) per https://github.com/eclipse/gmp.graphiti/blob/master/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/ImageService.java and https://bugs.eclipse.org/bugs/show_bug.cgi?id=527235

(same exception format) what bugs me is that I used the default palette, so I was hoping to stay in the 256 limit

philip-alldredge commented 3 years ago

GIF support will be discontinued. Closing.