Jump to content
You must now use your email address to sign in [click for more info] ×

Search the Community

Showing results for tags 'python'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Affinity Support
    • News and Information
    • Frequently Asked Questions
    • Affinity Support & Questions
    • Feedback & Suggestions
  • Learn and Share
    • Tutorials (Serif and Customer Created Tutorials)
    • Share your work
    • Resources
  • Bug Reporting
    • V2 Bugs found on macOS
    • V2 Bugs found on Windows
    • V2 Bugs found on iPad
    • Reports of Bugs in Affinity Version 1 applications
  • Beta Software Forums
    • 2.4 New Features and Improvements
    • Other New Bugs and Issues in the Betas
    • Beta Software Program Members Area
    • [ARCHIVE] Reports from earlier Affinity betas

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Member Title

Found 8 results

  1. Hi all, I'm looking for a way to automatically import images in photo from a text list of URLs… just like the title says ! And even more, I wish I could mix that within a macro to (for example) export all the files with a given width and a new computed name. Also, I think I could do that with macOS shortcuts app but I've never used it so… if someone could help… I'd be very grateful ! Thanks Edit : it might also be done with a small python routine ???
  2. I'm currently studying Python and wanted to try all of the escape sequences, however my code appears to have a fault. Could you please assist me in locating it? My Code: string = """backslash - \\\nsingle quote - \'\ndouble quote - \" ASCII bell - \a Lorem ASCII backspace - \b Lorem ACII formfeed - \f Lorem Unicode - \N{prabhu} Ipsum Carriage return - \r Ipsum 16 bit Hex value - \u1234 32 bit Hex value - \U12345678 ASCII Vertical tab - \v Octal value character - \123 Hex value - \x12 """ print(string) Output: Error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 137-146: unknown unicode character name
  3. Hi all, I created a design based on running data that I collected during the last 10 years. I am rather a data scientist than a designer and also a beginner in using Affinity Designer. Nevertheless, I thought I post the results here to get some feedback on this. Highly appreciated. You will find the whole work and its description in my medium article: https://towardsdatascience.com/create-beautiful-art-from-your-personal-data-9dc0abfeeaf Again, I would love to hear your thoughts. Thank you and all the best Gregor
  4. Hi, I needed to create arrays of images to show a distribution. Say you wanted to display the amount of male to female workers, or, like in my case the number of nominations in relation to the numbers of wins. So, I wrote a simple python script to do it. It's using graphicsmagick (http://www.graphicsmagick.org/) for the actual image stuff. It works like size: You give it a number of images, and specify how many of these images you want. By default it will arrange those images in a square grid, but you can also specify the number of columns you want to produce different layouts. You can specify the size of a cell and the border around it. It will create a single output file using this data, which you can then use in your Affinity tools. Right now it displays the images in order, but I could change it to display them randomly if needed. #!/usr/local/bin/python3 import math import os # the number per image type counts = [94,199] # the actual filenames to use images = ["A.png", "B.png"] # what should be produced outFilename = "out.png" # size of the cells cellWidth = 100 cellHeight = 100 # number of columns. If set to zero, it will create # a layout with the same number of rows and columns. columns = 0 # ---------------------------------- # Implementation # # Basically, it creates list of files for # graphicsmagick's (http://www.graphicsmagick.org/montage.html) # montage tool. # # On a mac you can use # brew install graphicsmagick # in a terminal to install graphicsmagick if you don't have it already # total = 0 for count in counts: total += count if ( columns == 0 ): columns = math.ceil( math.sqrt( total ) ) rows = math.ceil( total / columns ) totalRemaining = total curType = 0 typeRemaining = counts[curType] params = "" while totalRemaining > 0: params += images[curType] + " " totalRemaining = totalRemaining - 1 typeRemaining = typeRemaining - 1 if typeRemaining == 0: # switch to next image curType = curType + 1 typeRemaining = counts[ min(curType, len(images)-1 )] # call graphicsmagick to do the hard work for us: os.system( f'gm montage -background none -geometry {cellWidth}x{cellHeight}+10+10 -tile {columns}x{rows} {params} {outFilename}') Maybe it's something you can find use for. If you're on a mac, you can use on the command line to install it. I hope this is in the correct forum, tand that somebody might find this useful. Thanks, DasLenny
  5. Hey guys! Is in your plans allowing programmers to control the affinity programs with code? Like commands/actions in Python, C# or Javascript? Preferibly Python or C#. So we programmers can develop commands/actions that people can install or run to execute certain tasks. I need a definitive answer to this, to see if it's worth waiting for it, or a definitive NO! Thank you!
  6. Hello, I'm a Python programmer (mid) I saw that y'all are making a affinity for website, y'all has think in enter to the python community?
  7. I was curious to know if there are any hopes that down the road a python or some sort of scripting API will be available for Affinity Applications like Designer/Photo. Working in the film/vfx/games industry for over 10 years now, one of the biggest headaches is developing pipeline tools for Adobe applications due to their constraints and poor choice of Java implementation for API. I would love to see a modern API like python supported in Affinity applications. Thanks guys, keep up the great work!
  8. I recently discovered that Affinity Designer will copy paths to the clipboard as SVG Documents, so I decided to use it for some simple automation. I wrote a simple python script to simplify SVG paths: https://gist.github.com/NickBeeuwsaert/004851e7f7571b288f3c And here is a example of it in action: before: Copy path with Command+V execute on command line: $ pbpaste | python svg_simplify.py | pbcopy And then paste back into Affinity Designer: I just thought it might be a cool tip for anyone who uses SVG optimization tools for web development... I'd like to set up a Automator script to streamline it but Automator is acting up for me today :/ Also: If you have imagemagick and potrace installed (usually via brew), you can rasterize a image from AFD using this (after copying the image from AFD) using: $ pbpaste | convert svg:- pnm:- | potrace -s - -o - | pbcopy (P.S. I hope this is the right area of the forum to post...)
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.