# logo3=drawCustomLogo(logoPath=logo3Path),
                    # instagram= drawIGaccount(instaAccount='@Rzf.Gsh'),
                    hashTag= drawHashtag(hashTag='Hadist qudsi'),
                    logo1= drawHashtag(hashTag='Islamic quotes'),
                    targetHeight= int(img.size[1]/15),
                    isLight=True,
                    ratioWidth = 50,
                    ratioHeight = 80,
                    )
                    
img = drawAnotherSosmed(image=img,
                    ratioHeight=2.5,
                    useOverlay=True,
                    account_IG = '@rzf.gsh',
                    account_FB = 'M Razif Rizqullah',
                    account_WA = None,
                    account_LINE = 'r.linkgish',
                    account_TELEGRAM = None,
                    account_WEB = None,
                    account_TWITTER = '@linkgish',
                    account_YOUTUBE = 'Razif Rizqullah')

img = drawCopyright(image=img)

# Use time as a unique file name, so it will not be duplicated in the future
nowTime = ctime()
# Input variable of time into the string 
savePath = ('/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Result-lib/Style1 {}.jpg').format(nowTime)
img.save(savePath)
print('Successfully saved at : ',savePath) # Notification while done
img.thumbnail((500,500))    # Just show thumbnail instead of full size image, because we should keep the quality
Example #2
0
banner = drawBannerDetail(image=banner,
                        placeText = 'Ruang H5, Gedung H, Fakultas Teknik, UNILA, Kota Bandar Lampung, Lampung, Indonesia',
                        dateText = 'Senin, 13 Agustus 2019',
                        timeText = 'Pukul 08.00 s.d. 16.00 WIB',
                        ratioXpaste=65,
                        ratioXsize=30,
                        )

banner = drawAnotherSosmed(#isTrue=False,
                        image=banner,
                        ratioHeight = 3,
                        useOverlay = True,
                        forceColor= (255,255,255,255),
                        account_IG = '@FSLDKLampung' ,
                        account_FB = 'Puskomda FSLDK Lampung' ,
                        account_WA = None ,
                        account_LINE = None ,
                        account_TELEGRAM = None ,
                        account_WEB = 'https://fsldklampung.id' ,
                        account_TWITTER = 'FSLDK Lampung',
                        account_YOUTUBE = None,
                        ratioXpaste = 80,
                        ratioYpaste = 92,
                    )

biiLogoPath = '/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Image-lib/Logo-lib/Logo-birohmah.png'
fsldkLogoPath = '/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Image-lib/Logo-lib/logo-fsldklampung.png'
unilaLogoPath = '/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Image-lib/Logo-lib/logo-unila.png'
banner = drawOranizerLogo(image=banner,
                        logo_1=unilaLogoPath,
                        logo_2=biiLogoPath,
                        logo_3=fsldkLogoPath,
Example #3
0
    # instagram= drawIGaccount(instaAccount='@Rzf.Gsh'),
    hashTag=drawHashtag(hashTag='baik berisik'),
    targetHeight=int(img.size[1] / 15),
    isLight=True,
    ratioWidth=50,
    ratioHeight=80,
)
# Drw socmed account left it None or Blank if there is no account

img = drawAnotherSosmed(
    image=img,
    account_IG='@Rzf.Gsh',
    account_FB='M Razif Rizqullah',
    # account_TELEGRAM='LinkGish',
    # account_WA = '082238639221' ,
    # account_LINE = 'r.linkgish' ,
    # account_WEB = 'linkgish.com' ,
    account_TWITTER='LinkGish',
    # account_YOUTUBE = 'M Razif Rizqullah',
    ratioHeight=2.5,
    useOverlay=True,
    # fontColor=(55,71,79),
)

img = makeBodyTextNano2(
    image=img,
    fontPath=
    '/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Font-lib/Comfortaa/Comfortaa-Bold.ttf',
    text=
    "Pulau asal kita sama. Pulau tujuan kita sama. Yang membedakan hanya jembatannya saja,.",
    placeXRatio=25,
    placeYRatio=40,
Example #4
0
def instaPostStyle2MainProgram(
    titleText='AI DESIGN',
    fontTitlePath='Font-lib/Comfortaa/Comfortaa-SemiBold.ttf',
    subTitleText='Instant Design',
    fontSubTitlePath='Font-lib/Love_Ya_Like_A_Sister/LoveYaLikeASister-Regular.ttf',  #'/Font-lib/Comfortaa/Comfortaa-SemiBold.ttf',
    logoAiDesign=None,
    logoMDC=None,
    logoYukShare=None,
    customLogo1=None,
    customLogo2=None,
    customHastagLogo=None,
    backgroundCategory=None,
    backgroundImage=None,
):
    # print('---------------')
    # print(fontTitlePath)
    # print('---------------')
    # print(fontSubTitlePath)
    if backgroundImage != '-- Pilih Kategori --':
        img = backgroundSelection(category=backgroundCategory).convert(
            'RGB')  #Select background from random image in a category
    elif backgroundImage:
        img = Image.open(backgroundImage)
    #there is 4 category City, Dawn, Dusk, Night
    # img = Image.open('/home/linkgish/Desktop/AiDesign_01/Image-lib/background-lib/City/city-wallpaper-27.jpg')  #Import a single image as background
    #Converting PIL to OpenCV format (2 Dimension to 3 Dimensional Array)
    img = np.array(img)
    img = img[:, :, ::-1].copy()
    #Gamma correction using openCV
    gammaIs = whatsGamma(img)  #Determine the number of gamma correction
    img = GammaCorrection(image=img,
                          gamma=gammaIs)  #Apply the gamma correction
    img_size = 2000  #Change the image size, so it will be better for uploading
    img = crop1x1_cv2(
        img, img_size)  #Crop the image in square dimension using OpenCV
    # Convert OpenCV format to PIL format
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    img = Image.fromarray(img)
    #Done, now any further code is using PIL instead
    #Making the big text, and small text
    # maroon = '#FFA781'

    img = drawTitleStyle2(
        bigText=titleText,  #"GEMPA BUMI", 
        fontPath=os.path.abspath(
            fontTitlePath
        ),  #'/home/linkgish/Desktop/AiDesign_01/Font-lib/Love_Ya_Like_A_Sister/LoveYaLikeASister-Regular.ttf',
        littleText=subTitleText,  #'Hanya Peristiwa Alam?',
        subFontPath=os.path.abspath(fontSubTitlePath),
        imageSource=img,
        bigTextColor=randomMaterialColor(
            typeColor=LIGHTorDARK(image=img)
        ),  #LIGHTorDARK(image=img),#, #selectColor(color='grey'),
        littleTextColor=randomMaterialColor(typeColor=LIGHTorDARK(image=img)),
        bigFontSize=1300,
        littleTextSize=500,
    )
    # Draw the copyright section in the bottom right
    img = drawCopyright(image=img)
    # Draw some logo in a combination size
    islogoMDC = None
    if logoMDC == True:
        islogoMDC = drawMDClogo()

    islogoYukShare = None
    if logoYukShare == True:
        islogoYukShare = drawHashtag(hashTag='YUK SHARE')

    img = combineLogo(
        image=img,
        mdc=islogoMDC,
        logo1=islogoYukShare,  # drawCustomLogo(logoPath=logo1Path),
        # logo2=drawCustomLogo(logoPath=logo2Path),
        # logo3=drawCustomLogo(logoPath=logo3Path),
        # instagram= drawIGaccount(instaAccount='@Rzf.Gsh'),
        hashTag=drawHashtag(hashTag='baik berisik'),
        # logo3= drawHashtag(hashTag='generasi tarbiyah'),
        targetHeight=int(img.size[1] / 15),
        isLight=True,
        ratioWidth=50,
        ratioHeight=80,
    )

    # Drw socmed account left it None or Blank if there is no account
    img = drawAnotherSosmed(
        image=img,
        useOverlay=True,
        account_IG='Rzf.Gsh',
        account_FB='M Razif Rizqullah',
        # account_TELEGRAM='LinkGish',
        account_WA=None,
        account_LINE=None,
        account_WEB=None,
        # account_TWITTER = 'LinkGish',
        account_YOUTUBE=None,
        ratioHeight=2.5,
        # fontColor=(55,71,79),
    )
    # Use time as a unique file name, so it will not be duplicated in the future
    nowTime = ctime()
    # Input variable of time into the string
    savePath = (
        '/home/linkgish/Desktop/AiDesign_01/Result-lib/instaStyle2/Style2 {}.jpg'
    ).format(nowTime)
    img.save(savePath)
    print('Successfully saved at : ', savePath)  # Notification while done
    img.thumbnail(
        (500, 500)
    )  # Just show thumbnail instead of full size image, because we should keep the quality
    img.show()  #Show the result


# instaPostStyle2MainProgram()
# print(os.path.abspath('AiDesign_01/Font-lib/Comfortaa/Comfortaa-SemiBold.ttf'))
                    # instagram= drawIGaccount(instaAccount='@Rzf.Gsh'),
                    hashTag= drawHashtag(hashTag='baik berisik'),
                    # logo3= drawHashtag(hashTag='generasi tarbiyah'),
                    targetHeight= int(img.size[1]/15),
                    isLight=True,
                    ratioWidth = 50,
                    ratioHeight = 80,
                    )
                    
# Drw socmed account left it None or Blank if there is no account
img = drawAnotherSosmed(image=img,
                    useOverlay=True,
                    account_IG='Rzf.Gsh',
                    account_FB='M Razif Rizqullah',
                    # account_TELEGRAM='LinkGish',
                    account_WA = None ,
                    account_LINE = None ,
                    account_WEB = None ,
                    # account_TWITTER = 'LinkGish',
                    account_YOUTUBE = None,
                    ratioHeight=2.5,
                    # fontColor=(55,71,79),
                    )
# Use time as a unique file name, so it will not be duplicated in the future
nowTime = ctime()
# Input variable of time into the string 
savePath = ('/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Result-lib/instaStyle2/Style2 {}.jpg').format(nowTime)
img.save(savePath)
print('Successfully saved at : ',savePath) # Notification while done
img.thumbnail((500,500))    # Just show thumbnail instead of full size image, because we should keep the quality
img.show() #Show the result
Example #6
0
                        bigFontSize=1300,
                        littleTextSize=500,
                        )

img = drawCopyright(image=img)
img = combineLogo(image=img,
                    mdc=drawMDClogo(),
                    instagram= drawIGaccount(instaAccount='@Rzf.Gsh'),
                    hashTag= drawHashtag(hashTag='Quotes Muslim'),
                    targetHeight= int(img.size[1]/15),
                    )

img = drawAnotherSosmed(image=img,
                    account_IG='@Rzf.Gsh',
                    account_FB='M Razif Rizqullah',
                    account_TELEGRAM='LinkGish',
                    account_WA = None ,
                    account_LINE = None ,
                    account_WEB = None ,
                    account_TWITTER = 'LinkGish',
                    account_YOUTUBE = None,
                    ratioHeight=2,
                    )

nowTime = ctime()

savePath = ('/home/linkgish/Desktop/WebApp2/GeneticDesignProject/Result-lib/Style2 {}.jpg').format(nowTime)
img.save(savePath)
print('Successfully saved at : ',savePath)
img.thumbnail((500,500))
img.show()