{"id":4454,"date":"2016-10-06T00:00:00","date_gmt":"2016-10-05T22:00:00","guid":{"rendered":"http:\/\/evolve.rabatmalta.com\/?guid=173cd04ace5993b2b3123995f733ba8d"},"modified":"2016-10-06T00:00:00","modified_gmt":"2016-10-05T22:00:00","slug":"making-settings-persistent-in-gimp","status":"publish","type":"post","link":"https:\/\/evolve.rabatmalta.com\/?p=4454","title":{"rendered":"Making settings persistent in GIMP"},"content":{"rendered":"<p>Until fairly recently <span class=\"caps\">GIMP<\/span> didn&#8217;t do a very good job of remembering all the types of customizations. If you applied a filter to an image and liked the combination of options that you used, there was no way you could save that combination for a later use. If you carefully chose selection stroking options, the next time you had to stroke a selection, you had to define settings all over&nbsp;again.<\/p>\n<p>Upcoming v2.10 has some major improvements in that&nbsp;department.<\/p>\n<figure>\n    <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-filter-named-presets.jpg?resize=920%2C417&#038;ssl=1\" alt=\"Adding a named preset for the Unsharp Mask filter in GIMP\" width=\"920\" height=\"417\" \/><br \/>\n<\/figure>\n<p>Early in the current development cycle we started porting existing <span class=\"caps\">GIMP<\/span> filters to <span class=\"caps\">GEGL<\/span> operations and using the <span class=\"caps\">GEGL<\/span> tool skeleton to wrap their GUIs into. This made it possible to automatically save each used combination as preset with a timestamp for a name, or manually&mdash;as a named preset. If you&#8217;ve been using v2.9.2 or v2.9.4, you most likely benefit from that&nbsp;already.<\/p>\n<figure>\n    <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-masks-in-xcf.jpg?resize=920%2C562&#038;ssl=1\" alt=\"Using masks for digital photrography in GIMP\" width=\"920\" height=\"562\" \/><br \/>\n<\/figure>\n<p>The second part of improvements started with reviewing a <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=759601\">patch<\/a> submitted by Benoit Touchette. As a professional photographer, he regularly works on hundreds of photos daily and has an extensive use of masks, so he needs to get from A to B extremely fast. Benoit came up with a clever idea to simplify adding new masks: clicking on layers&#8217; previews. Various modifier keys would additionally define whether you apply and remove the mask or just drop the mask&nbsp;entirely.<\/p>\n<figure>\n    <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-easy-mask-create-tooltip.jpg?resize=920%2C506&#038;ssl=1\" alt=\"Tooltips for handling masks quickly in GIMP\" width=\"920\" height=\"506\" \/><br \/>\n<\/figure>\n<p>The difficult part was to come up with a way to remember the last used mask initiation setting not just within one session, but across sessions. So instead of creating a special case for just the <em>Add Layer Mask<\/em> dialog, Michael Natterer added a whole new infrastructure to automatically save and load the settings of&nbsp;dialogs.<\/p>\n<p>All the dialog defaults are stored in the <em>gimprc<\/em> configuration file. To give you an idea, this is how stroking options are saved in <em>gimprc<\/em>:<\/p>\n<div class=\"codehilite\">\n<pre><span class=\"p\">(<\/span><span class=\"n\">stroke<\/span><span class=\"o\">-<\/span><span class=\"n\">options<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">style<\/span> <span class=\"n\">solid<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">antialias<\/span> <span class=\"n\">yes<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">method<\/span> <span class=\"n\">line<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">width<\/span> 6<span class=\"p\">.<\/span>000000<span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">unit<\/span> <span class=\"n\">pixels<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">cap<\/span><span class=\"o\">-<\/span><span class=\"n\">style<\/span> <span class=\"n\">butt<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">join<\/span><span class=\"o\">-<\/span><span class=\"n\">style<\/span> <span class=\"n\">miter<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">miter<\/span><span class=\"o\">-<\/span><span class=\"n\">limit<\/span> 10<span class=\"p\">.<\/span>000000<span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">dash<\/span><span class=\"o\">-<\/span><span class=\"n\">offset<\/span> 0<span class=\"p\">.<\/span>000000<span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">dash<\/span><span class=\"o\">-<\/span><span class=\"n\">info<\/span> 0<span class=\"p\">)<\/span>\n    <span class=\"p\">(<\/span><span class=\"n\">emulate<\/span><span class=\"o\">-<\/span><span class=\"n\">brush<\/span><span class=\"o\">-<\/span><span class=\"n\">dynamics<\/span> <span class=\"n\">no<\/span><span class=\"p\">))<\/span>\n<\/pre>\n<\/div>\n<p>The options are preserved for dialogs like <em>New Channel<\/em>, <em>Feather Selection<\/em>, <em>Stroke Path<\/em> and others. To give you visual control over the settings, Michael created a new page in the <em>Preferences<\/em> dialog called <em>Dialog Defaults<\/em>.<\/p>\n<figure>\n    <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-prefs-dialog-defaults.png?resize=805%2C638&#038;ssl=1\" alt=\"Dialog Defaults preferences page in GIMP 2.9.5\" width=\"805\" height=\"638\" \/><br \/>\n<\/figure>\n<p>You may have noticed a few more new things about the <em>Preferences<\/em> dialog. There is now a scrollbar on large pages to make the dialog fit small screens like the still popular 1366&#215;768 on lower-end laptops (quite a few <span class=\"caps\">GIMP<\/span> users reported that <em>Preferences<\/em> was getting too big). Additionally, some pages now feature a reset button that restores default&nbsp;settings.<\/p>\n<p>The dialog defaults feature will be available in <span class=\"caps\">GIMP<\/span> 2.9.6 and, eventually, in <span class=\"caps\">GIMP<\/span>&nbsp;2.10.<\/p>\n<p>The introduction of filter presets and dialog defaults gets us closer to resolving <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=63610\">#63610<\/a>, <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=120829\">#120829<\/a>, and <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=599573\">#599573<\/a>, filed in 2001, 2003, and 2009 respectively. If you think that more dialogs could benefit from either saving their settings as defaults or getting named presets, please drop by on <a href=\"https:\/\/www.gimp.org\/irc.html\"><span class=\"caps\">IRC<\/span><\/a> or the <a href=\"https:\/\/www.gimp.org\/mail_lists.html\">mailing list<\/a> for developers and tell&nbsp;us.<\/p>\n<p>If you are interested in helping out with getting <span class=\"caps\">GIMP<\/span> 2.10 released, please check out the <a href=\"http:\/\/wiki.gimp.org\/wiki\/Hacking:TODO#2.10\"><span class=\"caps\">TODO<\/span><\/a>&nbsp;page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Until fairly recently <span>GIMP<\/span> didn&rsquo;t do a very good job of remembering all the types of customizations. If you applied a filter to an image and liked the combination of options that you used, there was no way you could save that combination for a later use. If you carefully chose selection stroking options, the next time you had to stroke a selection, you had to define settings all over&nbsp;again.<\/p>\n<p>Upcoming v2.10 has some major improvements in that&nbsp;department.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-filter-named-presets.jpg\" alt=\"Adding a named preset for the Unsharp Mask filter in GIMP\" width=\"975\" height=\"442\"><\/figure>\n<p>Early in the current development cycle we started porting existing <span>GIMP<\/span> filters to <span>GEGL<\/span> operations and using the <span>GEGL<\/span> tool skeleton to wrap their GUIs into. This made it possible to automatically save each used combination as preset with a timestamp for a name, or manually&mdash;as a named preset. If you&rsquo;ve been using v2.9.2 or v2.9.4, you most likely benefit from that&nbsp;already.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-masks-in-xcf.jpg\" alt=\"Using masks for digital photrography in GIMP\" width=\"975\" height=\"596\"><\/figure>\n<p>The second part of improvements started with reviewing a <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=759601\">patch<\/a> submitted by Benoit Touchette. As a professional photographer, he regularly works on hundreds of photos daily and has an extensive use of masks, so he needs to get from A to B extremely fast. Benoit came up with a clever idea to simplify adding new masks: clicking on layers&rsquo; previews. Various modifier keys would additionally define whether you apply and remove the mask or just drop the mask&nbsp;entirely.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-easy-mask-create-tooltip.jpg\" alt=\"Tooltips for handling masks quickly in GIMP\" width=\"975\" height=\"536\"><\/figure>\n<p>The difficult part was to come up with a way to remember the last used mask initiation setting not just within one session, but across sessions. So instead of creating a special case for just the <em>Add Layer Mask<\/em> dialog, Michael Natterer added a whole new infrastructure to automatically save and load the settings of&nbsp;dialogs.<\/p>\n<p>All the dialog defaults are stored in the <em>gimprc<\/em> configuration file. To give you an idea, this is how stroking options are saved in <em>gimprc<\/em>:<\/p>\n<div>\n<pre><span>(<\/span><span>stroke<\/span><span>-<\/span><span>options<\/span>\n    <span>(<\/span><span>style<\/span> <span>solid<\/span><span>)<\/span>\n    <span>(<\/span><span>antialias<\/span> <span>yes<\/span><span>)<\/span>\n    <span>(<\/span><span>method<\/span> <span>line<\/span><span>)<\/span>\n    <span>(<\/span><span>width<\/span> 6<span>.<\/span>000000<span>)<\/span>\n    <span>(<\/span><span>unit<\/span> <span>pixels<\/span><span>)<\/span>\n    <span>(<\/span><span>cap<\/span><span>-<\/span><span>style<\/span> <span>butt<\/span><span>)<\/span>\n    <span>(<\/span><span>join<\/span><span>-<\/span><span>style<\/span> <span>miter<\/span><span>)<\/span>\n    <span>(<\/span><span>miter<\/span><span>-<\/span><span>limit<\/span> 10<span>.<\/span>000000<span>)<\/span>\n    <span>(<\/span><span>dash<\/span><span>-<\/span><span>offset<\/span> 0<span>.<\/span>000000<span>)<\/span>\n    <span>(<\/span><span>dash<\/span><span>-<\/span><span>info<\/span> 0<span>)<\/span>\n    <span>(<\/span><span>emulate<\/span><span>-<\/span><span>brush<\/span><span>-<\/span><span>dynamics<\/span> <span>no<\/span><span>))<\/span>\n<\/pre>\n<\/div>\n<p>The options are preserved for dialogs like <em>New Channel<\/em>, <em>Feather Selection<\/em>, <em>Stroke Path<\/em> and others. To give you visual control over the settings, Michael created a new page in the <em>Preferences<\/em> dialog called <em>Dialog Defaults<\/em>.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gimp.org\/news\/2016-10-06%20Dialog%20Defaults\/gimp-2-9-5-prefs-dialog-defaults.png\" alt=\"Dialog Defaults preferences page in GIMP 2.9.5\" width=\"805\" height=\"638\"><\/figure>\n<p>You may have noticed a few more new things about the <em>Preferences<\/em> dialog. There is now a scrollbar on large pages to make the dialog fit small screens like the still popular 1366&#215;768 on lower-end laptops (quite a few <span>GIMP<\/span> users reported that <em>Preferences<\/em> was getting too big). Additionally, some pages now feature a reset button that restores default&nbsp;settings.<\/p>\n<p>The dialog defaults feature will be available in <span>GIMP<\/span> 2.9.6 and, eventually, in <span>GIMP<\/span>&nbsp;2.10.<\/p>\n<p>The introduction of filter presets and dialog defaults gets us closer to resolving <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=63610\">#63610<\/a>, <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=120829\">#120829<\/a>, and <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=599573\">#599573<\/a>, filed in 2001, 2003, and 2009 respectively. If you think that more dialogs could benefit from either saving their settings as defaults or getting named presets, please drop by on <a href=\"https:\/\/www.gimp.org\/irc.html\"><span>IRC<\/span><\/a> or the <a href=\"https:\/\/www.gimp.org\/mail_lists.html\">mailing list<\/a> for developers and tell&nbsp;us.<\/p>\n<p>If you are interested in helping out with getting <span>GIMP<\/span> 2.10 released, please check out the <a href=\"http:\/\/wiki.gimp.org\/wiki\/Hacking:TODO#2.10\"><span>TODO<\/span><\/a>&nbsp;page.<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/evolve.rabatmalta.com\/?p=4454\"> Continue reading<\/a><\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[17,6,44,15],"tags":[],"class_list":["post-4454","post","type-post","status-publish","format-standard","hentry","category-articles","category-floss","category-imaging","category-oss"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9jmWQ-19Q","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/posts\/4454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4454"}],"version-history":[{"count":2,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/posts\/4454\/revisions"}],"predecessor-version":[{"id":4713,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=\/wp\/v2\/posts\/4454\/revisions\/4713"}],"wp:attachment":[{"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/evolve.rabatmalta.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}