Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,392
» Latest member: Wirelessvsa
» Forum threads: 6,686
» Forum posts: 36,442

Full Statistics

Latest Threads
Can this be simplified/dr...
Forum: General questions
Last Post: Blighty
2 hours ago
» Replies: 9
» Views: 156
Some old pixel art done i...
Forum: Gallery
Last Post: TumbleRocks
2 hours ago
» Replies: 8
» Views: 199
Simplifying a path
Forum: Extending the GIMP
Last Post: PixLab
10 hours ago
» Replies: 24
» Views: 11,044
Can't use Color to alpha ...
Forum: General questions
Last Post: Ofnuts
Yesterday, 08:22 AM
» Replies: 6
» Views: 238
back to GIMP after years ...
Forum: Other graphics software
Last Post: st_barr
05-17-2024, 09:26 AM
» Replies: 2
» Views: 86
Does Script-Fu support in...
Forum: Extending the GIMP
Last Post: esm
05-16-2024, 12:49 PM
» Replies: 4
» Views: 169
How common is your PIN?
Forum: Watercooler
Last Post: PixLab
05-16-2024, 01:17 AM
» Replies: 8
» Views: 540
SOOOOOOOOOOO close in cle...
Forum: General questions
Last Post: Ofnuts
05-15-2024, 07:17 PM
» Replies: 6
» Views: 195
Q: Can AI Solve Scripting...
Forum: Scripting questions
Last Post: Tas_mania
05-14-2024, 09:09 AM
» Replies: 4
» Views: 248
Rings around Brush instea...
Forum: General questions
Last Post: Jafaraway
05-14-2024, 12:03 AM
» Replies: 2
» Views: 161

 
  Import pdf - how to ensure imported image's print size equals pdf-file's page size?
Posted by: Cattleya - 08-17-2023, 03:37 PM - Forum: General questions - Replies (4)

Questions are:

  1. When importing into GIMP a pdf-file (for exporting as jpg or png or gif), how to ensure that the measurements of the print size of the imported image equal the measurements of the pdf-file's page size?
  2. When importing a pdf-file into in GIMP - how to ensure that displaying the imported image at a zoom-factor of 100% takes an area equal to the pdf-file's page size?

Long story:

I created a pdf-file with pdfLaTeX, packages TikZ/pgfplots/standalone.
A graph of a function, ticks of x- and y-axis are 1 cm apart from each other when displaying at a zoom factor of 100%.
According to document properties in Adobe Reader 9 and in KDE Okular 1.3.2, page size is 12,495 cm x 12,343 cm.
I.e., width of the pdf's page is 12,495 cm and height of the pdf's page is 12,343 cm.

When viewing the pdf-file at a zoom factor of 100% in Adobe Reader 9 or in KDE Okular 1.3.2, then the area on the screen taken for displaying the pdf's page in fact is 12,495 cm x 12,343 cm. (I used a caliper for measuring the area on the screen. ;-) ). Resolution of my monitor is 94 dpi both in horizontal and in vertical direction.
Edit/Preferences/Interface/Display in GIMP 2.10.8 also says that the monitor resolution detected automatically is 94 dpi.

When importing the pdf-file into GIMP (Gnu Image Manipulation Program, 2.10.8), I am asked to give a resolution in pixel/inch.

I expect the following behavior in GIMP:

  1. In any case the print size after importing should be as close to the pdf's page size as possible, 12,495 cm x 12,343 cm.
  2. The measurements of the area on the screen taken by the image displayed at a zoom factor of 100% should in any case also be as close to the pdf's page size as possible, 12,495 cm x 12,343 cm.
Thus the imported image's size in pixels should be calculated so that
[imported image's width in pixels]/[resolution given in pixel/inch]*2.54cm/inch = [width of pdf's page in cm] 
<->  [imported image's width in pixels] = [width of pdf's page in cm] * [resolution given in pixel/inch] * inch/2.54cm 
and
[imported image's height in pixels]/[resolution given in pixel/inch]*2.54cm/inch = [height of pdf's page in cm] 
<->  [imported image's height in pixels] = [height of pdf's page in cm] * [resolution given in pixel/inch] * inch/2.54cm .

E.g., when choosing resolution 100 dpi x 100 dpi, then with the pdf-file in question I expect
[imported image's width in pixels] = 12,495 cm * [100 pixel/inch] * inch/2.54cm = 492 pixel and
[imported image's height in pixels] = 12,443 cm * [100 pixel/inch] * inch/2.54cm = 489 pixel.

E.g., when choosing monitor's resolution, 94 dpi x 94 dpi, then with the pdf-file in question I expect
[imported image's width in pixels] = 12,495 cm * [94 pixel/inch] * inch/2.54cm = 462 pixel and
[imported image's height in pixels] = 12,443 cm * [94 in pixel/inch] * inch/2.54cm = 460 pixel.

But not only the size in pixels varies, but also the print size and the area used for displaying on screen at a zoom-factor of 100% both deviate from the pdf-file's page-size and vary depending on what resolution in pixel/inch you give.

E.g., when at the time of importing the pdf-file I chose resolution 100 dpi x 100 dpi, then according to Image - Image properties 
size in pixels is  490 x 486 pixels and
print size is 12,45 cm x 12,3 4cm.
Displaying with a zoom-factor of 100% takes an area on the screen of size 13,24 cm x 13,21 cm.
Notice that height and width of the imported image in pixels differs from what I expect.
Notice the difference between the print size of the imported image and the pdf's page size.
Notice the difference between the print size of the imported image and the area taken for displaying on screen at a zoom factor of 100%.

E.g., when at the time of importing the pdf-file I chose the monitor's resolution, 94 dpi x 94 dpi, then according to Image - Image properties 
size in pixels is 461 x 456 pixels and
print size is 12,46 cm x 12,32 cm.
Displaying with a zoom-factor of 100% takes an area on the screen of size 12,64 cm x 12,36 cm.
Notice that height and width of the imported image in pixels differs from what I expect.
Seems, when giving the monitor's resolution for the pixels/inch-resolution, then both the print size of the imported image and the area taken for displaying the imported image on screen at a zoom factor of 100% are very close to the pdf's page size.

The differences in print sizes with the imported images and the deviating of print sizes of imported images from the pdf's page size show that importing the pdf into GIMP goes along with stretching the image horizontally and vertically.
That stretching seems to depend on the resolution in pixel/inch specified at the time of importing the pdf-file into GIMP. 
That stretching causes with the exported jpg distance of the ticks on the x- and y-axis of the graph of the function not being 1 cm any more.

Also, the print size of the imported image does not reflect the measurements of the area taken for displaying the imported image at a zoom-factor of 100%, although GIMP seems to have proper information about the monitor's resolution.

Print this item

  Blending Layers
Posted by: bcripps - 08-16-2023, 03:05 PM - Forum: General questions - Replies (6)

   
   
Hey Gimpers:
Is there a way to blend two layers with out using Opacity?
I want to see the flames through the image of the girl without dropping her opacity to 70%; e.g. like holding two transparencies up to the light.
Much thanks…
Bry

Print this item

  updating documentation
Posted by: jacques_duflos - 08-15-2023, 04:50 PM - Forum: Scripting questions - Replies (3)

Hi there,
I sometimes bump into inconsistencies in the python script documentation (or things that look like so to me, I'm not at all an expert). 

Here is an example : the gimp_image_insert_layer's documentation displayed in the python procedure navigator is :

Quote:This procedure adds the specified layer to the image at the given position. If the specified parent is a valid layer group (See 'gimp-item-is-group' and 'gimp-layer-group-new') then the layer is added inside the group. If the parent is 0, the layer is added inside the main stack, outside of any group. The position argument specifies the location of the layer inside the stack (or the group, if a valid parent was supplied), starting from the top (0) and increasing. If the position is specified as -1 and the parent is specified as 0, then the layer is inserted above the active layer, or inside the group if the active layer is a layer group. The layer type must be compatible with the image base type.

But specifying 0 as parent returns an error
Code:
➤> img=gimp.image_list()[0]
➤> layer = pdb.gimp_layer_new(img, 100, 100, RGB_IMAGE, "layer", 100, 0)
➤> pdb.gimp_image_insert_layer(img, layer, 0, 0)
Traceback (most recent call last):
 File "<input>", line 1, in <module>
TypeError: wrong parameter type
➤>


after struggling a little, I found out that you should use None instead of 0
Code:
➤> img=gimp.image_list()[0]
➤> layer = pdb.gimp_layer_new(img, 100, 100, RGB_IMAGE, "layer", 100, 0)
➤> pdb.gimp_image_insert_layer(img, layer, None, 0)
➤> img.layers
[<gimp.Layer 'layer'>, <gimp.Layer 'Arrière-plan'>]
➤>
From my point of view, the documentation should be modified (correct me if I'm wrong).
It's not a bug as such, but maybe it would be useful to report it through the bug report procedure ?

Print this item

  Where is G'MIC?
Posted by: Zero01 - 08-15-2023, 02:45 PM - Forum: General questions - Replies (4)

Can't get G'MIC to appear in the Filters list, I'm on a Windows 10 64-bit PC with the latest GIMP 2.10.34 (Revision 2).
Tried everything, must be missing something? Uninstalled GIMP from the Program Files directory, uninstalled G'MIC too, then re-installed (both latest versions). Set preferences, plug-in dirs etc, to no avail, still no G'MIC.. All my other plug-ins are there..
Currently deleting my brain lol..

Print this item

  panoramic viewer
Posted by: denzjos - 08-14-2023, 07:07 PM - Forum: Other graphics software - Replies (2)

FSPViewer is a free viewer for spherical (equirectangular) panoramic images
https://www.fsoft.it/FSPViewer/
I've made some panoramic photos and stitch them with gimp to get a full rotated view. To make a less or more good transition I have rotate the whole panorama photo to get the left and the right side on the same level with the help of a straight horizontal path. The example is poor quality because I can't post a big photo here.
   

Print this item

  Mass blur images via Python-Fu
Posted by: everetttt - 08-14-2023, 05:26 PM - Forum: Scripting questions - Replies (2)

Hello, I am wanting to streamline a process to blur every image (all jpegs) in a directory that I have, as doing it all manually would be extremely time consuming. I have found many people using Python-Fu, and so I believe to add my scrip to GIMP I would open any file, Filters -> Python-Fu -> Console and enter code, of which I have the following

Code:
from gimpfu import*

def plugin_blur_post(timg, tdrawable):


   new_layer = pdb.gimp_layer_copy(tdrawable, 0)
   timg.add_layer (new_layer, 0)
    
   pdb.plug_in_gauss_iir(timg, new_layer, 25, True,True)
   gimp.pdb.file_jpeg_save(timg, new_layer, (car (gimp-image-get-filename)) + "_blurred.jpg", "raw_filename", 0.85, 0, 0, 1, "", 3, 0, 0, 0)


register(
       "python_fu_blur",
       "blur-posterize",
       "*",
       "*",
       "*",
       "*",
       "<Image>/Tools/blur-posterize...",
       "*",
       [],
       [],
       plugin_blur_post)

main()
This, I hope, adds a gaussian blur with both X and Y values of 25, then saves as a new jpeg, with the name being currentName_blurred.jpg
Unfortunately, this just crashes the console when I copy paste it all in.

Finally, as I want to apply this to all files in my directory (including images within folders), I believe I have to run a similar command as found here. So, I believe I would navigate to the folder and run the command
Code:
gimp -i -b '(python_fu_blur "*.jpg" 5.0 0.5 0)' -b '(gimp-quit 0)'
As the code doesn't yet compile, I can't run the command, but in Windows Powershell gimp is not even recognized as a name. I've tried both this and this but neither allow me to call gimp.

I realize this is effectively three separate errors in one post and I do apologize for that. Thank you for any help offered, I really do appreciate it.

Print this item

  How to remove sample points?
Posted by: nelo - 08-13-2023, 08:08 AM - Forum: General questions - Replies (2)

Hallo all,

I've set sample pints in my picture.
How do I delete them when I do no longer need them?

Print this item

  patterns
Posted by: ibohme - 08-12-2023, 10:22 PM - Forum: General questions - Replies (2)

Hi
I am having trouble saving patterns i have made, i have read a lot of post of how other people fixed their problem but nothing seems to work, funny thing is i saved one and it worked then i tried to save another and now neither work. When i try to save i have to click all these in order to get to the patterns folder
Saving: Local disk gimp 2 share gimp 2.0 patterns
i have also clicked and selected show hidden folders
i have refreshed and restarted gimp
but the patterns still dont show on the dialog box however they are in the patterns folder i have also tried to put them into a new folder and not even that works

Print this item

Thumbs Up GIMP in school
Posted by: PixLab - 08-12-2023, 03:50 AM - Forum: Watercooler - Replies (3)

It's a bit less than a week that my children get back to school, yesterday my eldest told me:

"Papa, the teacher told us that this year in computer science we will use GIMP"
Big Grin Cool

Print this item

Video help gimp find the camera
Posted by: isayhello2u - 08-12-2023, 02:49 AM - Forum: General questions - Replies (5)

I have  acquired an old used koolertron book scanner  (without a manual or software -so far have not been able to obtain either)    my window 11 pc  thinks its a usb 2.0 web camera.   but i would like to take photos directly from gimp   (i always update so im sure its the newest version of gimp)    I can take photos with microsoft camera app then upload to gimp.  but i would like to take a photo more directly as  im working with paper too large and fragile for a normal scanner   even a hand held one.    Gimp create can find my hp printer/scanner and my cannon/scanner  but can not find any usb connected camera.     I saw a reply on a similar question that said something about twain.   but im very end user computer illiterate  and need something that says  something like  step one go here and step two click that   step three type this  etc so on and so forth.   is there any one who can advise me?

Print this item