Simple KWin Rule. Raises GIMP window to front when opening an image in GIMP from the file manager or another source.
Works on Plasma5 and likely under Plasma4 too since the text generated appears to be essentially the same.
Note: This is merely a KWin Window Rule, not a KWin Script. See install instructions below.
This rule will likely only work with GIMP single window mode. Making it work with multiple docked dialogs may be as simple as changing the line wmclass=gimp-2.8 to something more generic. Modify this same line as appropriate if using a GIMP version other than 2.8.
Save this file to a location of your choice, e.g. the Downloads directory, ensuring it has the extension .kwinrule
In System Settings under the Plasma Desktop, go to Window Management, and click the Window Rules tab. Click Import.
Navigate to the directory where you saved the .kwinrule file and select it. Click Apply in the main Window Rules dialog.
You should now find the new rule prepended to the main kwinrulesrc file in ~/.config (or for Plasma4, ~/.kde4/share/config).