Post Reply 

Using gimp for Google street view

Apr 2, 2018, 12:24
Post: #1
Using gimp for Google street view
Hello everyone,
I am fighting hard, but I think it<s time for me to call for help.
I am not really new to programing but it<s a hobby.
Code:
import gimp
import gimpfu
import os, glob

path = "C:\\test"
outdir = os.path.join(path, "output")
if not os.path.exists(outdir):
    os.mkdir(outdir)

for jpg in glob.glob(os.path.join(path, "*.jpg")):
    img = pdb.gimp_file_load(jpg, "")
    disp = pdb.gimp_display_new(img)
    new_width = 12000
    new_height = 6000
    pdb.gimp_image_scale(img, new_width, new_height)
    
    #Newlayer= pdb.gimp_layer_new(img,12000, 6000, 0, "background", 100.0, NORMAL_MODE)
    #img.add_layer(Newlayer, 1)
    #background = pdb.gimp_context_get_background()
    #NewLayer= background
    
    num , ids= pdb.gimp_image_get_layers(img)
    zora= gimp.Item.from_id(ids[0])
    
    pdb.gimp_layer_resize(zora ,12000, 5575, 0, 0)
    
    #layer = pdb.gimp_image_merge_down(img, zora, 1)
    
    drawable = pdb.gimp_image_get_active_layer(img)
    zoneselection=pdb.gimp_rect_select(img,0,5500,12000,30,2,0,0)
    zonecopy= pdb.gimp_edit_copy(drawable)
    a=30
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=60
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=90
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=120
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=150
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=180
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=210
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=240
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=270
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=300
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=330
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=360
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=390
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=420
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=450
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    a=480
    zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,100,2,0,0)
    floating_sel = pdb.gimp_edit_paste(drawable, True)
    #a=510
    #zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,90,2,0,0)
    #floating_sel = pdb.gimp_edit_paste(drawable, True)
    #a=540
    #zoneselection2=pdb.gimp_rect_select(img,0,5500+a,12000,60,2,0,0)
    #floating_sel = pdb.gimp_edit_paste(drawable, True)
    
    pdb.gimp_image_merge_visible_layers(img, 2 )
    
    newjpg = os.path.join(outdir, os.path.basename(jpg))
    pdb.file_jpeg_save(img, img.active_layer, newjpg,"", 1.0, 0.0, 0, 0, "", 2, 1, 0, 2)
    pdb.gimp_display_delete(disp)

I have a picture, I need to make it 1/2,
but I need to keep the ratio.
then one layer for the background and one for the image in itself.
I make copies of the low part of the image, to cover the part of the background.
I need the image to be a certain size, but
I am never able to reduce the image and not the back ground.
Help will be reallllly really appreciate.
[/php]
Find all posts by this user
Quote this message in a reply
Apr 2, 2018, 12:29
Post: #2
RE: Using gimp for Google street view
This forum has been DEAD for a long time and is abandoned to spammers.

We've all gone to https://www.gimp-forum.net
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Printers not showing in gimp chrismacor 1 59 May 24, 2018 06:03
Last Post: paynekj
  Gimp 2.8 wont't see my wcoom bamboo tablet NullPointer 1 61 May 22, 2018 12:53
Last Post: paynekj
  Gimp compatibility katie98 1 63 May 22, 2018 05:53
Last Post: paynekj
  Using Adobe Typekit fonts within GIMP? Kevin M 10 1,384 May 21, 2018 16:07
Last Post: T.Mitarai
  GIMP redefines my keyboard shortcuts kardosrobertkh 1 98 May 13, 2018 19:20
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS