+#if defined(WIN32_PIPE_TO_PROCESSES)
+
+ string command;
+
+ command=strprintf("convert -depth 8 -size %dx%d rgb%s:-[0] -density %dx%d \"%s\"\n",
+ desc.get_w(), desc.get_h(), // size
+ ((channels(pf) == 4) ? "a" : ""), // rgba or rgb?
+ round_to_int(desc.get_x_res()/39.3700787402), // density
+ round_to_int(desc.get_y_res()/39.3700787402),
+ newfilename.c_str());
+
+ file=popen(command.c_str(),POPEN_BINARY_WRITE_TYPE);
+
+#elif defined(UNIX_PIPE_TO_PROCESSES)
+