It is currently Wed Jun 19, 2013 12:58 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-patch)
PostPosted: Tue May 04, 2010 11:52 pm  (#1) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 2269
Location: Gimpville
Software List

OS: Fedora 12 (i686) (Gnome Desktop)
Gimp: v2.6.9
Gimp Apng Plug-in: v0.1.0
libpng-1.2.44
libpng-1.2.44-apng.patch
GNU C Compiler (gcc)

GIMP APNG Plug-in Installation Guide For Linux

This is a basic guide to installing GIMP APNG Plug-in in Linux. For demonstration purposes of this guide, Fedora 12 will be the distribution used. However, other than distro dependent install paths, the same basic steps would apply to other Linux distributions as well.

In this guide, we will

a) patch libpng with the libpng-apng-patch,
b) compile and install the patched libpng
c) compile GIMP-APNG-Plug-in against our newly patched libpng

You can also install a pre-patched libpng, if you can find one. ;)

If your distribution includes a pre-patched version of libpng with APNG support, you can skip directly to Section II.

Pre-install requirement

Ensure you have installed the development tools provided by your Linux distribution. In Fedora 12, the most popular and frequently used development tools automake, gcc, perl, python can be installed with a single click under: System/Administration/Add-Remove-Software (under Package Collection, select Development Tools

Ensure GIMP and libpng-devel are both installed on your system. Check your software repository to determine which version of libpng is used by your distribution.

Fedora 12 and Fedora 13 currently use libpng-1.2.44.



Section I - Patching, compiling and installing lipng with APNG support

1) Create a folder titled: gimp-apng
2) Download the libpng source code: for your distribution into the gimp-apng folder.

Fedora 12 uses: libpng-1.2.44 which can be downloaded here.

3) Extract libpng-1.2.44.tar.gz (creates a subfolder /gimp-apng/libpng-1.2.44).

4) Download the libpng-apng patch that corresponds to your distribution's version of libpng

Fedora 12 currently uses: libpng-1.2.44-apng.patch which can be downloaded here.

5) Extract the contents of libpng-1.2.44-apng.patch.gz and copy the patch file into the /gimp-apng/libpng-1.2.44 folder.
6) Open a terminal and change into the /gimp-apng/libpng-1.2.44 folder
7) As a normal user, patch libpng-1.2.44 with the libpng-1.2.44-apng.patch using the following command..

patch -p1 < libpng-1.2.44-apng.patch

8) Compile the patched libpng-1.2.44 using the following commands.

Note: Use the "--prefix" option to specify an installation path other than the current default of: /usr/local

In Fedora 12, we will use the install path: /usr

./configure --prefix=/usr
make

9) As Root, install the patched libpng-1.2.44 using the following command..

make install

Completing without error, a patched version of libpng with APNG support will be installed.



Section II: Compile and install the GIMP plug-in: gimp-apng-0.1.0

1) Download Gimp Apng Plug-in: v0.1.0 into your user created gimp-apng folder.
2) Extract gimp-apng-0.1.0.tar.bz2 (creates a subfolder /gimp-apng/gimp-apng-0.1.0).
3) Open a terminal into the /gimp-apng/gimp-apng-0.1.0 folder
4) As a normal user, run the following two commands..

./configure
make

5) As Root, install the Gimp Apng Plug-in..

make install

In Fedora 12, the Gimp Apng Plug-in will be installed in a newly created hidden folder under .gimp-2.6.x/plug-ins. You will have to manually copy the gimp-apng plug-in to your gimp-2.6/plug-ins folder. This is likely the case with most other Linux distributions as well.

I also highly recommend removing file-png from the system's plug-in folder (/usr/lib/gimp/2.0/plug-ins). This will direct control to the new gimp-apng-plugin by default when saving.

Once the plug-in is installed, you will have three new options for animated PNGs on the PNG save dialog.

Image

Note from the plugin Developer
Quote:
First frame must be full size (and second frame must be full size too, if first frame is hidden).

Failure to follow this convention will resuilt in a save error..

libpng error: width and/or height in the first frame's fcTL don't match the ones in IHDR

I received this error when the top layer in my layer dialog was not the same size as the overall image.

Once I resized the top layer to the image size, I was able to save as an animated PNG.

This plugin also allows loading of multi-layer animated PNGs with all layers intact.



PNGs are a superior file format supporting 24bit color depth verses 8bit GIFs. .

Thanks to Oregonian for a great comparison of the difference between animated GIFs -vs- PNGs.

____GIF_________PNG____
ImageImage

A few more animated PNGs samples.

3D T-Rex
Image

Rotating Glass
Image

SpinFox
Image

Post updated: 07/07/2010 - (updated how-to on Fedora 12/13 to reflect updated libpng-1.2.44)

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 

 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 2:13 am  (#2) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
:wh My first animation using the gimp apng plugin. No semiflattening of drop shadows. Way kewl. This one is 104.1kg in size.

Image

Same image semiflattened, indexed and saved as a gif file. 55.4kb.

Image

Gradient areas need to be larger to see the dithering.

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 3:10 am  (#3) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
... another one with Silvertayl's Siamese Fighting Fish.
apng
Image

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 5:59 am  (#4) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 7124
cool. love the gimp chat font and sparkles love the turning jar, excellent... woot

_________________
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 3:10 pm  (#5) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 2269
Location: Gimpville
These two images demonstrate the difference between animated PNG -vs- GIF really well. You can see the GIF struggling to produce the gradient, resorting to dithering. The PNG is smooth with no dithering.

GIF
Image

PNG
Image

It's all about color depth. :cool

_________________
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 3:45 pm  (#6) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
Cool demo GnuTux. :2thup

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Wed May 05, 2010 9:14 pm  (#7) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
I got the package of frames here. What I don't understand is why the frames (images) were all semi-flattened and index mode. I put them in rgb mode and un-semi-flattened them by running them through color to alpha and removed the white. The image on the right has the sign removed that detects he apng viewing capabilities of the image viewer.

ImageImageImage

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 

 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Thu May 06, 2010 2:25 am  (#8) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 2269
Location: Gimpville
I'll wager the person putting together that APNG demo just grabbed that stickman animation which was originally an animated gif. For purposes of demonstrating the online APNG creator, it really doesn't matter that the image started as a .gif.

He just grabbed something to save time. That's my guess. I've been there. :keybdtype

Wonder why we haven't seen a Windows version of this plug-in? Surely there are lots of winfans around with a C compiler. ;)

I've never attempted to setup a cross compiler environment but that might be fun. I hear it's kinda tricky to setup but it would be cool to be able to compile the same code across Linux, Windows & MAC with a few keystrokes.

Here's a good idea. Create a Cross Compiler Linux distribution (call it CC Linux) where everything is pre-configured and tweaked for development using a cross compiler environment. That would be sweet!! When do we start? :lol

_________________
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Thu May 06, 2010 9:47 am  (#9) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
GnuTux wrote:
Wonder why we haven't seen a Windows version of this plug-in? Surely there are lots of winfans around with a C compiler. ;)

I've never attempted to setup a cross compiler environment but that might be fun. I hear it's kinda tricky to setup but it would be cool to be able to compile the same code across Linux, Windows & MAC with a few keystrokes.

Here's a good idea. Create a Cross Compiler Linux distribution (call it CC Linux) where everything is pre-configured and tweaked for development using a cross compiler environment. That would be sweet!! When do we start? :lol

I've pretty much traveled the Internet looking for a Windows version and couldn't find one. Found a few places where there were requests. Usually it's we Linux users that have to wait for a Linux version. It should be taking off soon I would hope.

Great idea about a cross compiler. Your work is cut out for you. :keybdtype :sleepkbd

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
 Post subject: Re: Compiling Gimp APNG Plug-in using Linux (iibpng-apng-pat
PostPosted: Sat May 15, 2010 12:08 pm  (#10) 
Offline
Administrator
User avatar

Joined: May 22, 2008
Posts: 5665
Location: Somewhere in GIMP
Image Windows users go here for the Windows version.

_________________
Image
Law of Gravity - Any tool, nut, bolt, screw, when dropped, will roll to the least accessible place.
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login  

* Subscribe to Gimp Chat's RSS Feed    * Subscribe to Gimp Chat's Tutorial RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group