bbbbbr / gimp-plugin-pixel-art-scalers Goto Github PK
View Code? Open in Web Editor NEWGimp plugin for scaling / rescaling images with Pixel Art Scaler algorithms such as hqx, xbr and scalex
License: GNU General Public License v3.0
Gimp plugin for scaling / rescaling images with Pixel Art Scaler algorithms such as hqx, xbr and scalex
License: GNU General Public License v3.0
❓ It may be worth replacing this awkward and inconvenient function reference with a wrapper of the form:
void scalers_select(uint32_t * sp, uint32_t * dp, int Xres, int Yres, int factor, int numalg){...}
Not?
Originally posted by @nightmaredream in #2 (comment)
About "seamless" processing...
And about "pixels stuck to sides" on semi-transparent images...
I'll show you an example of side stuck upscale pixels.
The left mushroom thing's topmost part is squared, that's because the upscale process bounces to borders...
It would be difficult to difference different jobs, so separating seamless batch from no-repeat batch would allow to do, in one batch, save borders.. And in the other batch... Emulate seamlessness with copies of the tiles in every directions and then reduce back to original size.
But yeah, for the moment, a tolerance slider... Then making every tolerated pixels fully opaque!
Seamlessness examples
While it's still a very nice result, seamlessness is broken.
Hi @bbbbbr .
See stbiscalenx: Stb Image Scale Near X.
This method is very similar to ScaleX. This method does not add new colors, only uses those that already exist. Replacing equal
with near
makes color selection more flexible, allowing pixel scaling techniques to be applied even to full-color images. I use this to scale scanned material containing a lot of glyphs and contours.
origin | x2 | x3 |
---|---|---|
Thank you very much for doing this, bbbbbr. It should have been in main GIMP for decades.
On my devuan ceres linux, building with libgtk2.0-dev Version: 2.24.33-2 fails with:
gcc -c src/filter_dialog.c -o obj/filter_dialog.o -pthread -I/usr/local/include/libpng17 -I/usr/include/gtk-2.0 -I/usr/lib/aarch64-linux-gnu/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/aarch64-linux-gnu -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -pthread -I/usr/local/include/libpng17 -I/usr/include/gimp-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/aarch64-linux-gnu -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gegl-0.4 -I/usr/include/gio-unix-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/babl-0.1
In file included from /usr/include/gtk-2.0/gdk/gdkevents.h:34,
from /usr/include/gtk-2.0/gdk/gdkdisplay.h:32,
from /usr/include/gtk-2.0/gdk/gdkscreen.h:33,
from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:31,
from /usr/include/gtk-2.0/gdk/gdk.h:32,
from /usr/include/gtk-2.0/gtk/gtk.h:32,
from /usr/include/gimp-2.0/libgimp/gimpui.h:22,
from src/filter_dialog.c:19:
/usr/include/gtk-2.0/gdk/gdkcolor.h:74:3: warning: parameter names (without types) in function declaration
74 | gint GSEAL (size);
| ^~~~
/usr/include/gtk-2.0/gdk/gdkcolor.h:74:13: error: field ‘GSEAL’ declared as a function
74 | gint GSEAL (size);
The only possibly relevant discussion to GSEAL which I have found (with the now almost completely broken-for-FOSS web search engines) is here.
https://stackoverflow.com/questions/15569756/how-do-i-get-access-to-gsealed-values-from-gtk-widget-modify-gtkwidgets.
[Not able to insert a link because the new github owners have broken the comment editor for my browser.]
Hi, I'm trying to batch a large number of images with your plugin in BIMP and I'm having some issues. I can't seem to control the resolution or much of anything really. These are the options I see:
The end result of the image also results in 3/4ths of the image being cut out, leaving only the upper left corner:
if you could please advise, I have a very large amount of images to process and I would greatly appreciate the help
Could you please implement the xBRZ filter? It is produces slightly more refined outputs and would be very helpful.
gimp-plugin-pixel-art-scalers/src/filter_dialog.c
Lines 197 to 206 in b96891d
Maybe?:
// Attach the label and combo to the table and show them all
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_scaler_label, 0, 1, 0, 1); // Left side of table
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_scaler_combo, 1, 2, 0, 1); // Left side of table
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_semi_transparency_checkbutton, 0, 1, 1, 2); // Left side of table
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_semi_transparency_spinbutton, 1, 2, 1, 2); // Left side of table
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_hidden_colors_checkbutton, 0, 1, 2, 3); // Left side of table
gtk_table_attach_defaults (GTK_TABLE (settings_table), settings_hidden_colors_spinbutton, 1, 2, 2, 3); // Left side of table
Apparently, macports is also an option, but I use homebrew and i didn't want to mix the two package managers.
Luckily, @ryan-robeson set up a tap which includes libgimp (for https://github.com/bootchk/resynthesizer), and installing it allowed make
to work. https://gist.github.com/ryan-robeson/5841f712ff23c910bbbfac793c16bfad#3---install-dependencies
And the default directory to install the plugin is ~/Library/Application\ Support/GIMP/2.10/plug-ins
And it works!
I can submit a simple PR to update the readme.
The migration to GTK3 will likely break the plugin. Deprecated GTK and libgimp function calls will need to be replaced.
No action will be taken until after the GIMP 3 release. This is just a placeholder for now.
Also see:
Hi, when i upscale any image, any mode, that has an alpha channel and transparency in it, it makes a contour line of glitched colors from pink to white and so on. I really need a solid line, and i'm batch doing files so i can't just go around and remove these contour lines one by one, it's a skull-scratching issue. Pixel art should Never have glitched contour lines, ever. I can't understand why this plugins isn't pre-fixed about that. IT'S obvious that upscaled sprites needs solid edges.
Batch-jobbing with Gimp is already a hassle (Using tinytask, doing eveything manually, automated, it's time-expensive)... Adding supplementary tasks such as "create layer mask, posterize mask, go filter, generic, erode, then saving, for every files with an alpha channel, consumes a lot of time... hence, your plugin should do solid edges.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.