{"action":"opened","issue":{"url":"https://api.github.com/repos/seifertm/gral-migrate-test/issues/107","labels_url":"https://api.github.com/repos/seifertm/gral-migrate-test/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/seifertm/gral-migrate-test/issues/107/comments","events_url":"https://api.github.com/repos/seifertm/gral-migrate-test/issues/107/events","html_url":"https://github.com/seifertm/gral-migrate-test/issues/107","id":64960861,"number":107,"title":"Improve text rendering quality when using the BitmapWriter","user":{"login":"eseifert","id":3323691,"avatar_url":"https://avatars.githubusercontent.com/u/3323691?v=3","gravatar_id":"","url":"https://api.github.com/users/eseifert","html_url":"https://github.com/eseifert","followers_url":"https://api.github.com/users/eseifert/followers","following_url":"https://api.github.com/users/eseifert/following{/other_user}","gists_url":"https://api.github.com/users/eseifert/gists{/gist_id}","starred_url":"https://api.github.com/users/eseifert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eseifert/subscriptions","organizations_url":"https://api.github.com/users/eseifert/orgs","repos_url":"https://api.github.com/users/eseifert/repos","events_url":"https://api.github.com/users/eseifert/events{/privacy}","received_events_url":"https://api.github.com/users/eseifert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-28T16:26:49Z","updated_at":"2015-03-28T16:26:49Z","closed_at":null,"body":"The default text quality when producing an PNG (or JPEG) file using the {{{BitmapWriter}}} is not great, sometimes barely readable.\r\n\r\nThis can be improved by passing {{{RenderingHints}}}.\r\n\r\nThe [source:gral-core/src/main/java/de/erichseifert/gral/io/plots/BitmapWriter.java@7e213103a2e85914793be05839c4d1b45f97483f#L163 current code in BitmapWriter] uses this:\r\n\r\n{{{\r\nDrawingContext context = new DrawingContext((Graphics2D)image.getGraphics());\r\n}}}\r\n\r\nThis can be improved using this instead:\r\n\r\n{{{\r\n        Graphics2D graphics = (Graphics2D) image.getGraphics();\r\n        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r\n                RenderingHints.VALUE_ANTIALIAS_ON);\r\n        graphics.setRenderingHint(RenderingHints.KEY_RENDERING,\r\n                RenderingHints.VALUE_RENDER_QUALITY);\r\n        graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,\r\n                RenderingHints.VALUE_INTERPOLATION_BICUBIC);\r\n        graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,\r\n                RenderingHints.VALUE_FRACTIONALMETRICS_ON);\r\n        DrawingContext context = new DrawingContext(graphics);\r\n}}}\r\n\r\nI'm attaching a couple of files to illustrate the difference ({{{test1.png}}} is produced with version 0.10 and {{{test2.png}}} is produced with this change).\n\n _Imported from trac ticket #111,  created by bruno on 05-18-2014 at 22:02, last modified: 05-20-2014 at 14:21_\n"}}