Code

these didn't compile for me. so let's try this.
[inkscape.git] / src / ui / dialog / tracedialog.cpp
index ad9e324bc056c277e08bcdeaf8c5e8392740beaa..01607bd5ddb309e887bccef6f1332d7514b3c394 100644 (file)
@@ -3,10 +3,11 @@
  * bitmap <image> into an svg <path>
  *
  * Authors:
- *   Bob Jamison
+ *   Bob Jamison <rjamison@titan.com>
+ *   Stéphane Gimenez <dev@gim.name>
  *   Other dudes from The Inkscape Organization
  *
- * Copyright (C) 2004, 2005 Authors
+ * Copyright (C) 2004-2006 Authors
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -81,17 +82,27 @@ class TraceDialogImpl : public TraceDialog
 
     void potracePreviewCallback();
 
+    Gtk::HBox       mainHBox;
     Gtk::Notebook   notebook;
     Gtk::Tooltips   tips;
 
-    //########## Potrace items
-    Gtk::VBox             potraceBox;
+    //########## General items
+    Gtk::Frame            sioxFrame;
+    Gtk::VBox             sioxVBox;
+    Gtk::HBox             sioxBox;
+    Gtk::CheckButton      sioxButton;
+
+    //########## Potrace pages
+    Gtk::VBox             potraceModePageBox;
+    Gtk::VBox             potraceParamsPageBox;
+
     Gtk::RadioButtonGroup potraceGroup;
-    Gtk::CheckButton      potraceInvertButton;
-    Gtk::HBox             potraceInvertBox;
     Gtk::Button           *potraceOkButton;
     Gtk::Button           *potraceCancelButton;
 
+    //#### Modes
+
+    //## Single scan
     //brightness
     Gtk::Frame            potraceBrightnessFrame;
     Gtk::VBox             potraceBrightnessVBox;
@@ -99,8 +110,6 @@ class TraceDialogImpl : public TraceDialog
     Gtk::RadioButton      potraceBrightnessRadioButton;
     Gtk::Label            potraceBrightnessSpinnerLabel;
     Gtk::SpinButton       potraceBrightnessSpinner;
-
-
     //edge detection
     Gtk::Frame            potraceCannyFrame;
     Gtk::HBox             potraceCannyBox;
@@ -111,7 +120,6 @@ class TraceDialogImpl : public TraceDialog
     //Gtk::SpinButton     potraceCannyLoSpinner;
     Gtk::Label            potraceCannyHiSpinnerLabel;
     Gtk::SpinButton       potraceCannyHiSpinner;
-
     //quantization
     Gtk::Frame            potraceQuantFrame;
     Gtk::HBox             potraceQuantBox;
@@ -119,41 +127,57 @@ class TraceDialogImpl : public TraceDialog
     Gtk::RadioButton      potraceQuantRadioButton;
     Gtk::Label            potraceQuantNrColorLabel;
     Gtk::SpinButton       potraceQuantNrColorSpinner;
+    //params
+    Gtk::CheckButton      potraceInvertButton;
+    Gtk::HBox             potraceInvertBox;
 
-    //multiple path scanning
+    //## Multiple path scanning
     Gtk::Frame            potraceMultiScanFrame;
     Gtk::VBox             potraceMultiScanVBox;
-
+    //brightness
     Gtk::HBox             potraceMultiScanHBox1;
     Gtk::RadioButton      potraceMultiScanBrightnessRadioButton;
     Gtk::SpinButton       potraceMultiScanNrColorSpinner;
-
+    //colors
     Gtk::HBox             potraceMultiScanHBox2;
     Gtk::RadioButton      potraceMultiScanColorRadioButton;
-    Gtk::CheckButton      potraceMultiScanStackButton;
-
+    //grays
     Gtk::HBox             potraceMultiScanHBox3;
     Gtk::RadioButton      potraceMultiScanMonoRadioButton;
     Gtk::Label            potraceMultiScanNrColorLabel;
-
+    //params
+    Gtk::HBox             potraceMultiScanHBox4;
+    Gtk::CheckButton      potraceMultiScanStackButton;
     Gtk::CheckButton      potraceMultiScanSmoothButton;
-
-
-    //preview
-    Gtk::Frame            potracePreviewFrame;
-    Gtk::HBox             potracePreviewBox;
-    Gtk::Button           potracePreviewButton;
-    Gtk::Image            potracePreviewImage;
+    Gtk::CheckButton      potraceMultiScanBackgroundButton;
+
+    //#### Parameters
+
+    Gtk::Frame            potraceParamsFrame;
+    Gtk::VBox             potraceParamsVBox;
+    Gtk::HBox             potraceParamsSpecklesBox;
+    Gtk::CheckButton      potraceParamsSpecklesButton;
+    Gtk::Label            potraceParamsSpecklesSizeLabel;
+    Gtk::SpinButton       potraceParamsSpecklesSizeSpinner;
+    Gtk::HBox             potraceParamsCornersBox;
+    Gtk::CheckButton      potraceParamsCornersButton;
+    Gtk::Label            potraceParamsCornersThresholdLabel;
+    Gtk::SpinButton       potraceParamsCornersThresholdSpinner;
+    Gtk::HBox             potraceParamsOptimBox;
+    Gtk::CheckButton      potraceParamsOptimButton;
+    Gtk::Label            potraceParamsOptimToleranceLabel;
+    Gtk::SpinButton       potraceParamsOptimToleranceSpinner;
 
     //credits
     Gtk::Frame            potraceCreditsFrame;
     Gtk::VBox             potraceCreditsVBox;
     Gtk::Label            potraceCreditsLabel;
 
-    //########## Other items
-    Gtk::VBox             otherBox;
-
-
+    //########## Preview
+    Gtk::Frame            potracePreviewFrame;
+    Gtk::VBox             potracePreviewVBox;
+    Gtk::Button           potracePreviewButton;
+    Gtk::Image            potracePreviewImage;
 
 };
 
@@ -177,8 +201,14 @@ void TraceDialogImpl::potraceProcess(bool do_i_trace)
     bool invert = potraceInvertButton.get_active();
     pte.setInvert(invert);
 
-    //##### Get the single-scan settings
-    /* which one? */
+    //##### Get the preprocessor settings
+    /* siox -- performed by Tracer, and before any of the others */
+    if (sioxButton.get_active())
+        tracer.enableSiox(true);
+    else
+        tracer.enableSiox(false);
+
+    /* one of the following */
     if (potraceBrightnessRadioButton.get_active())
         pte.setTraceType(Inkscape::Trace::Potrace::TRACE_BRIGHTNESS);
     else if (potraceMultiScanBrightnessRadioButton.get_active())
@@ -198,6 +228,24 @@ void TraceDialogImpl::potraceProcess(bool do_i_trace)
         pte.setInvert(false);
         }
 
+    /* params */
+    int paramsSpecklesSize =
+      potraceParamsSpecklesButton.get_active() ?
+      potraceParamsSpecklesSizeSpinner.get_value_as_int() :
+      0;
+    pte.setParamsTurdSize(paramsSpecklesSize);
+    double paramsCornersThreshold =
+      potraceParamsCornersButton.get_active() ?
+      potraceParamsCornersThresholdSpinner.get_value() :
+      0.;
+    pte.setParamsAlphaMax(paramsCornersThreshold);
+    bool paramsOptim = potraceParamsOptimButton.get_active();
+    pte.setParamsOptiCurve(paramsOptim);
+    double paramsOptimTolerance = potraceParamsOptimToleranceSpinner.get_value();
+    pte.setParamsOptTolerance(paramsOptimTolerance);
+
+    //##### Get the single-scan settings
+
     /* brightness */
     double brightnessThreshold = potraceBrightnessSpinner.get_value();
     pte.setBrightnessThreshold(brightnessThreshold);
@@ -217,22 +265,25 @@ void TraceDialogImpl::potraceProcess(bool do_i_trace)
     pte.setMultiScanStack(do_i_stack);
     bool do_i_smooth = potraceMultiScanSmoothButton.get_active();
     pte.setMultiScanSmooth(do_i_smooth);
+    bool do_i_remove_background = potraceMultiScanBackgroundButton.get_active();
+    pte.setMultiScanRemoveBackground(do_i_remove_background);
 
     //##### Get intermediate bitmap image
-    GdkPixbuf *pixbuf = tracer.getSelectedImage();
+    Glib::RefPtr<Gdk::Pixbuf> pixbuf = tracer.getSelectedImage();
     if (pixbuf)
          {
-         GdkPixbuf *preview = pte.preview(pixbuf);
+         Glib::RefPtr<Gdk::Pixbuf> preview = pte.preview(pixbuf);
          if (preview)
              {
-             Glib::RefPtr<Gdk::Pixbuf> thePreview = Glib::wrap(preview);
-             int width  = thePreview->get_width();
-             int height = thePreview->get_height();
-             double scaleFactor = 100.0 / (double)height;
+             int width  = preview->get_width();
+             int height = preview->get_height();
+             double scaleFX = 200.0 / (double)width;
+             double scaleFY = 200.0 / (double)height;
+            double scaleFactor = scaleFX > scaleFY ? scaleFY : scaleFX;
              int newWidth  = (int) (((double)width)  * scaleFactor);
              int newHeight = (int) (((double)height) * scaleFactor);
              Glib::RefPtr<Gdk::Pixbuf> scaledPreview =
-                    thePreview->scale_simple(newWidth, newHeight,
+                    preview->scale_simple(newWidth, newHeight,
                        Gdk::INTERP_NEAREST);
              //g_object_unref(preview);
              potracePreviewImage.set(scaledPreview);
@@ -287,16 +338,10 @@ void TraceDialogImpl::potracePreviewCallback()
  */
 void TraceDialogImpl::responseCallback(int response_id)
 {
-
     if (response_id == GTK_RESPONSE_OK)
         {
-        int panelNr = notebook.get_current_page();
-        //g_message("selected panel:%d\n", panelNr);
-
-        if (panelNr == 0)
-            {
+               // for now, we assume potrace, as it's the only one we have
             potraceProcess(true);
-            }
         }
     else if (response_id == GTK_RESPONSE_CANCEL)
         {
@@ -308,13 +353,10 @@ void TraceDialogImpl::responseCallback(int response_id)
         return;
         }
 
-
-
 }
 
 
 
-
 //#########################################################################
 //## C O N S T R U C T O R    /    D E S T R U C T O R
 //#########################################################################
@@ -326,12 +368,10 @@ TraceDialogImpl::TraceDialogImpl()
 
     Gtk::VBox *mainVBox = get_vbox();
 
-#define MARGIN 4
-
-    //##Set up the Potrace panel
+#define MARGIN 2
 
     /*#### brightness ####*/
-    potraceBrightnessRadioButton.set_label(_("Brightness"));
+    potraceBrightnessRadioButton.set_label(_("Brightness cutoff"));
     potraceGroup = potraceBrightnessRadioButton.get_group();
     potraceBrightnessBox.pack_start(potraceBrightnessRadioButton, false, false, MARGIN);
     tips.set_tip(potraceBrightnessRadioButton, _("Trace by a given brightness level"));
@@ -348,17 +388,14 @@ TraceDialogImpl::TraceDialogImpl()
 
     potraceBrightnessVBox.pack_start(potraceBrightnessBox, false, false, MARGIN);
 
-    potraceBrightnessFrame.set_label(_("Image Brightness"));
-    //potraceBrightnessFrame.set_shadow_type(Gtk::SHADOW_NONE);
-    potraceBrightnessFrame.add(potraceBrightnessVBox);
-    potraceBox.pack_start(potraceBrightnessFrame, false, false, 0);
+    potraceBrightnessFrame.set_label(_("Single scan: creates a path"));
 
     /*#### canny edge detection ####*/
     // TRANSLATORS: "Canny" is the name of the inventor of this edge detection method
-    potraceCannyRadioButton.set_label(_("Optimal Edge Detection (Canny)"));
+    potraceCannyRadioButton.set_label(_("Edge detection"));
     potraceCannyRadioButton.set_group(potraceGroup);
     potraceCannyBox.pack_start(potraceCannyRadioButton, false, false, MARGIN);
-    tips.set_tip(potraceCannyRadioButton, _("Trace with edge detection by J. Canny's algorithm"));
+    tips.set_tip(potraceCannyRadioButton, _("Trace with optimal edge detection by J. Canny's algorithm"));
     /*
     potraceCannyBox.pack_start(potraceCannySeparator);
     potraceCannyLoSpinnerLabel.set_label(_("Low"));
@@ -379,23 +416,18 @@ TraceDialogImpl::TraceDialogImpl()
     potraceCannyHiSpinnerLabel.set_label(_("Threshold:"));
     potraceCannyBox.pack_end(potraceCannyHiSpinnerLabel, false, false, MARGIN);
 
-    potraceCannyVBox.pack_start(potraceCannyBox, false, false, MARGIN);
-
-    potraceCannyFrame.set_label(_("Edge Detection"));
-    //potraceCannyFrame.set_shadow_type(Gtk::SHADOW_NONE);
-    potraceCannyFrame.add(potraceCannyVBox);
-    potraceBox.pack_start(potraceCannyFrame, false, false, 0);
+    potraceBrightnessVBox.pack_start(potraceCannyBox, false, false, MARGIN);
 
     /*#### quantization ####*/
     // TRANSLATORS: Color Quantization: the process of reducing the number of colors
     //  in an image by selecting an optimized set of representative colors and then
     //  re-applying this reduced set to the original image.
-    potraceQuantRadioButton.set_label(_("Color Quantization"));
+    potraceQuantRadioButton.set_label(_("Color quantization"));
     potraceQuantRadioButton.set_group(potraceGroup);
     potraceQuantBox.pack_start(potraceQuantRadioButton, false, false, MARGIN);
     tips.set_tip(potraceQuantRadioButton, _("Trace along the boundaries of reduced colors"));
 
-    potraceQuantNrColorSpinner.set_digits(2);
+    potraceQuantNrColorSpinner.set_digits(0);
     potraceQuantNrColorSpinner.set_increments(1.0, 4.0);
     potraceQuantNrColorSpinner.set_range(2.0, 64.0);
     potraceQuantNrColorSpinner.set_value(8.0);
@@ -405,16 +437,22 @@ TraceDialogImpl::TraceDialogImpl()
     potraceQuantNrColorLabel.set_label(_("Colors:"));
     potraceQuantBox.pack_end(potraceQuantNrColorLabel, false, false, MARGIN);
 
-    potraceQuantVBox.pack_start(potraceQuantBox, false, false, MARGIN);
+    potraceBrightnessVBox.pack_start(potraceQuantBox, false, false, MARGIN);
+
+    /*#### swap black and white ####*/
+    potraceInvertButton.set_label(_("Invert image"));
+    potraceInvertButton.set_active(false);
+    potraceInvertBox.pack_start(potraceInvertButton, false, false, MARGIN);
+    potraceBrightnessVBox.pack_start(potraceInvertBox, false, false, MARGIN);
+    tips.set_tip(potraceInvertButton, _("Invert black and white regions"));
+
+    potraceBrightnessFrame.add(potraceBrightnessVBox);
+    potraceModePageBox.pack_start(potraceBrightnessFrame, false, false, 0);
 
-    potraceQuantFrame.set_label(_("Quantization / Reduction"));
-    //potraceQuantFrame.set_shadow_type(Gtk::SHADOW_NONE);
-    potraceQuantFrame.add(potraceQuantVBox);
-    potraceBox.pack_start(potraceQuantFrame, false, false, 0);
 
     /*#### Multiple scanning####*/
     //----Hbox1
-    potraceMultiScanBrightnessRadioButton.set_label(_("Brightness"));
+    potraceMultiScanBrightnessRadioButton.set_label(_("Brightness steps"));
     potraceMultiScanBrightnessRadioButton.set_group(potraceGroup);
     potraceMultiScanHBox1.pack_start(potraceMultiScanBrightnessRadioButton, false, false, MARGIN);
     tips.set_tip(potraceMultiScanBrightnessRadioButton, _("Trace the given number of brightness levels"));
@@ -431,83 +469,148 @@ TraceDialogImpl::TraceDialogImpl()
     potraceMultiScanVBox.pack_start(potraceMultiScanHBox1, false, false, MARGIN);
 
     //----Hbox2
-    potraceMultiScanColorRadioButton.set_label(_("Color"));
+    potraceMultiScanColorRadioButton.set_label(_("Colors"));
     potraceMultiScanColorRadioButton.set_group(potraceGroup);
     potraceMultiScanHBox2.pack_start(potraceMultiScanColorRadioButton, false, false, MARGIN);
     tips.set_tip(potraceMultiScanColorRadioButton, _("Trace the given number of reduced colors"));
 
-
     potraceMultiScanVBox.pack_start(potraceMultiScanHBox2, false, false, MARGIN);
 
     //---Hbox3
-    potraceMultiScanMonoRadioButton.set_label(_("Monochrome"));
+    potraceMultiScanMonoRadioButton.set_label(_("Grays"));
     potraceMultiScanMonoRadioButton.set_group(potraceGroup);
     potraceMultiScanHBox3.pack_start(potraceMultiScanMonoRadioButton, false, false, MARGIN);
-    tips.set_tip(potraceMultiScanMonoRadioButton, _("Same as Color, but convert result to grayscale"));
+    tips.set_tip(potraceMultiScanMonoRadioButton, _("Same as Colors, but the result is converted to grayscale"));
 
-    // TRANSLATORS: "Stack" is a verb here
-    potraceMultiScanStackButton.set_label(_("Stack"));
-    potraceMultiScanStackButton.set_active(true);
-    potraceMultiScanHBox3.pack_end(potraceMultiScanStackButton, false, false, MARGIN);
-    tips.set_tip(potraceMultiScanStackButton, _("Stack scans vertically (no gaps) or tile horizontally (usually with gaps)"));
+    potraceMultiScanVBox.pack_start(potraceMultiScanHBox3, false, false, MARGIN);
 
     // TRANSLATORS: "Smooth" is a verb here
     potraceMultiScanSmoothButton.set_label(_("Smooth"));
     potraceMultiScanSmoothButton.set_active(true);
-    potraceMultiScanHBox3.pack_end(potraceMultiScanSmoothButton, false, false, MARGIN);
+    potraceMultiScanHBox4.pack_start(potraceMultiScanSmoothButton, false, false, MARGIN);
     tips.set_tip(potraceMultiScanSmoothButton, _("Apply Gaussian blur to the bitmap before tracing"));
 
-    potraceMultiScanVBox.pack_start(potraceMultiScanHBox3, false, false, MARGIN);
+    // TRANSLATORS: "Stack" is a verb here
+    potraceMultiScanStackButton.set_label(_("Stack scans"));
+    potraceMultiScanStackButton.set_active(true);
+    potraceMultiScanHBox4.pack_start(potraceMultiScanStackButton, false, false, MARGIN);
+    tips.set_tip(potraceMultiScanStackButton, _("Stack scans on top of one another (no gaps) instead of or tiling (usually with gaps)"));
+
+    // TRANSLATORS: "Layer" refers to one of the stacked paths in the multiscan
+    potraceMultiScanBackgroundButton.set_label(_("Remove background"));
+    potraceMultiScanBackgroundButton.set_active(false);
+    potraceMultiScanHBox4.pack_start(potraceMultiScanBackgroundButton, false, false, MARGIN);
+    tips.set_tip(potraceMultiScanBackgroundButton, _("Remove bottom (background) layer when done"));
 
-    potraceMultiScanFrame.set_label(_("Multiple Scanning"));
+    potraceMultiScanVBox.pack_start(potraceMultiScanHBox4, false, false, MARGIN);
+
+    potraceMultiScanFrame.set_label(_("Multiple scans: creates a group of paths"));
     //potraceQuantFrame.set_shadow_type(Gtk::SHADOW_NONE);
     potraceMultiScanFrame.add(potraceMultiScanVBox);
-    potraceBox.pack_start(potraceMultiScanFrame, false, false, 0);
+    potraceModePageBox.pack_start(potraceMultiScanFrame, false, false, 0);
+
+    notebook.append_page(potraceModePageBox, _("Mode"));
+
+    //#### Parameters ####
+
+    //## Potrace Parameters
+    potraceParamsSpecklesButton.set_label(_("Suppress speckles"));
+    tips.set_tip(potraceParamsSpecklesButton,
+                _("Ignore small spots (speckles) in the bitmap"));
+    potraceParamsSpecklesButton.set_active(true);
+    //tips.set_tip(potraceParamsSpecklesButton, _(""));
+    potraceParamsSpecklesBox.pack_start(potraceParamsSpecklesButton, false, false, MARGIN);
+    potraceParamsSpecklesSizeSpinner.set_digits(0);
+    potraceParamsSpecklesSizeSpinner.set_increments(1, 10);
+    potraceParamsSpecklesSizeSpinner.set_range(0, 1000);
+    potraceParamsSpecklesSizeSpinner.set_value(2);
+    tips.set_tip(potraceParamsSpecklesSizeSpinner,
+                _("Speckles of up to this many pixels will be suppressed"));
+    potraceParamsSpecklesBox.pack_end(potraceParamsSpecklesSizeSpinner, false, false, MARGIN);
+    potraceParamsSpecklesSizeLabel.set_label(_("Size:"));
+    potraceParamsSpecklesBox.pack_end(potraceParamsSpecklesSizeLabel, false, false, MARGIN);
+
+    potraceParamsCornersButton.set_label(_("Smooth corners"));
+    tips.set_tip(potraceParamsCornersButton,
+                _("Smooth out sharp corners of the trace"));
+    potraceParamsCornersButton.set_active(true);
+    //tips.set_tip(potraceParamsCornersButton, _(""));
+    potraceParamsCornersBox.pack_start(potraceParamsCornersButton, false, false, MARGIN);
+    potraceParamsCornersThresholdSpinner.set_digits(2);
+    potraceParamsCornersThresholdSpinner.set_increments(0.01, 0.1);
+    potraceParamsCornersThresholdSpinner.set_range(0.0, 1.34);
+    potraceParamsCornersThresholdSpinner.set_value(1.0);
+    potraceParamsCornersBox.pack_end(potraceParamsCornersThresholdSpinner, false, false, MARGIN);
+    tips.set_tip(potraceParamsCornersThresholdSpinner,
+                _("Increase this to smooth corners more"));
+    potraceParamsCornersThresholdLabel.set_label(_("Threshold:"));
+    potraceParamsCornersBox.pack_end(potraceParamsCornersThresholdLabel, false, false, MARGIN);
+
+    potraceParamsOptimButton.set_label(_("Optimize paths"));
+    potraceParamsOptimButton.set_active(true);
+    tips.set_tip(potraceParamsOptimButton,
+                _("Try to optimize paths by joining adjacent Bezier curve segments"));
+    potraceParamsOptimBox.pack_start(potraceParamsOptimButton, false, false, MARGIN);
+    potraceParamsOptimToleranceSpinner.set_digits(2);
+    potraceParamsOptimToleranceSpinner.set_increments(0.05, 0.25);
+    potraceParamsOptimToleranceSpinner.set_range(0.0, 5.0);
+    potraceParamsOptimToleranceSpinner.set_value(0.2);
+    potraceParamsOptimBox.pack_end(potraceParamsOptimToleranceSpinner, false, false, MARGIN);
+    tips.set_tip(potraceParamsOptimToleranceSpinner,
+                _("Increase this to reduce the number of nodes in the trace by more aggressive optimization"));
+    potraceParamsOptimToleranceLabel.set_label(_("Tolerance:"));
+    potraceParamsOptimBox.pack_end(potraceParamsOptimToleranceLabel, false, false, MARGIN);
+
+    potraceParamsVBox.pack_start(potraceParamsSpecklesBox, false, false, MARGIN);
+    potraceParamsVBox.pack_start(potraceParamsCornersBox, false, false, MARGIN);
+    potraceParamsVBox.pack_start(potraceParamsOptimBox, false, false, MARGIN);
+    potraceParamsFrame.set_label(_("Options"));
+    potraceParamsFrame.add(potraceParamsVBox);
+    potraceParamsPageBox.pack_start(potraceParamsFrame, false, false, 0);
+
+    //## SIOX
+    //for now, put at the top of the potrace box.  something better later
+    sioxButton.set_label(_("SIOX foreground selection"));
+    sioxBox.pack_start(sioxButton, false, false, MARGIN);
+    tips.set_tip(sioxButton,
+        _("Cover the area you want to select as the foreground"));
+    sioxVBox.pack_start(sioxBox, false, false, MARGIN);
+    sioxFrame.set_label(_("SIOX"));
+    sioxFrame.add(sioxVBox);
+    potraceParamsPageBox.pack_start(sioxFrame, false, false, 0);
+
+    //## Credits
+    potraceCreditsLabel.set_text(_("Thanks to Peter Selinger, http://potrace.sourceforge.net"));
+    potraceCreditsVBox.pack_start(potraceCreditsLabel, false, false, MARGIN);
+    potraceCreditsFrame.set_label(_("Credits"));
+    potraceCreditsFrame.set_shadow_type(Gtk::SHADOW_NONE);
+    potraceCreditsFrame.add(potraceCreditsVBox);
+    potraceParamsPageBox.pack_end(potraceCreditsFrame, false, false, 0);
+
+    notebook.append_page(potraceParamsPageBox, _("Options"));
+
+    mainHBox.pack_start(notebook, true, true, MARGIN);
 
     /*#### Preview ####*/
-    potracePreviewButton.set_label(_("Preview"));
+    potracePreviewButton.set_label(_("Update"));
     potracePreviewButton.signal_clicked().connect(
          sigc::mem_fun(*this, &TraceDialogImpl::potracePreviewCallback) );
-    potracePreviewBox.pack_end(potracePreviewButton, false, false, 0);//do not expand
-    tips.set_tip(potracePreviewButton, _("Preview the result without actual tracing"));
+    potracePreviewVBox.pack_end(potracePreviewButton, false, false, 0);
+    tips.set_tip(potracePreviewButton, _("Preview the intermediate bitmap with the current settings, without actual tracing"));
 
-
-    potracePreviewImage.set_size_request(100,100);
+    potracePreviewImage.set_size_request(200,200);
     //potracePreviewImage.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
-    potracePreviewBox.pack_start(potracePreviewImage, true, true, 0);
+    potracePreviewVBox.pack_start(potracePreviewImage, true, true, 0);
     potracePreviewFrame.set_label(_("Preview")); // I guess it's correct to call the "intermediate bitmap" a preview of the trace
     //potracePreviewFrame.set_shadow_type(Gtk::SHADOW_NONE);
-    potracePreviewFrame.add(potracePreviewBox);
-    potraceBox.pack_start(potracePreviewFrame, true, true, 0);
-
-    /*#### swap black and white ####*/
-    potraceInvertButton.set_label(_("Invert"));
-    potraceInvertButton.set_active(false);
-    potraceInvertBox.pack_end(potraceInvertButton, false, false, MARGIN);
-    potraceBox.pack_start(potraceInvertBox, false, false, MARGIN);
-    tips.set_tip(potraceInvertButton, _("Invert black and white regions for single traces"));
-
-    /*#### Credits ####*/
-    potraceCreditsLabel.set_text(
-                                                        _("Thanks to Peter Selinger, http://potrace.sourceforge.net")
-                         );
-    potraceCreditsVBox.pack_start(potraceCreditsLabel, false, false, MARGIN);
-    potraceCreditsFrame.set_label(_("Credits"));
-    potraceCreditsFrame.set_shadow_type(Gtk::SHADOW_NONE);
-    potraceCreditsFrame.add(potraceCreditsVBox);
-    potraceBox.pack_start(potraceCreditsFrame, false, false, 0);
+    potracePreviewFrame.add(potracePreviewVBox);
 
-    /*done */
-    // TRANSLATORS: Potrace is an application for transforming bitmaps into
-    //  vector graphics (http://potrace.sourceforge.net/)
-    notebook.append_page(potraceBox, _("Potrace"));
+    mainHBox.pack_start(potracePreviewFrame, true, true, MARGIN);
 
-    //##Set up the Other panel
-    // This may be reenabled when we have another tracer; now an empty tab is confusing so I'm disabling it
-    //    notebook.append_page(otherBox, _("Other"));
+    //attach contents to the main VBox
+    mainVBox->pack_start(mainHBox);
 
-    //##Put the notebook on the dialog
-    mainVBox->pack_start(notebook);
+    //#### Global Controls
 
     //## The OK button
     potraceCancelButton = add_button(Gtk::Stock::STOP, GTK_RESPONSE_CANCEL);
@@ -542,14 +645,9 @@ TraceDialog *TraceDialog::create()
 TraceDialogImpl::~TraceDialogImpl()
 {
 
-
 }
 
 
-
-
-
-
 } //namespace Dialog
 } //namespace UI
 } //namespace Inkscape