Netlogo : Set Size and Position of drawing - image

I have created a Netlogo program in which I imported cars using following code:
import-drawing "F:\\BMW.png"
It imports the image as background and stretches the image in whole screen. I want to resize it, but cannot do it using set size 2 as its used for resizing of built in shapes (as far as I know). Can someone please guide me how can I resize my PNG image and also set it to a specific coordinates (say 0,14).
Any help will be appreciated. Thanks

It won't change anything for how your model works, so you can just use:
set-patch-size XXX
If you dont want to guess at what patch size you want, you can just drag the size smaller until it's about the size you want, then click on info for GUI and it will have a patch size there.
I'm not sure what you mean by resize your png however.

Related

Reduce size of a .png image without losing transparency

Basically, I'd like to resize or resample a .png image (in order to reduce its file size) and yet retain it's transparency.
Anybody got an idea how best to go about this?
Thanks.
You can use paint.net, it is a free tool. Although it is pretty basic, it does the job.
Go to Image > Resize
Stumbled upon this thread and found the following site that does exactly what is requested: https://onlinepngtools.com/resize-png
What graphics program are you using?
Photoshop does this by simply going thru IMAGE > IMAGE SIZE and resizing. Transparency is not affected.
I'm sure Paint Shop Pro does the same
I know this is an old question, but the answer that worked for me was to use Inkscape.
Start Inkscape (free on Inkscape.org).
File -> Import... (Ctrl+I) the PNG file you want to resize (defaults on import dialog are ok).
With the image you just imported selected, select File -> Export PNG image... (Shift+Ctrl+E)
In the Export PNG Image tool pane, click the Export As... button to set the output filename and location.
In this same tool pane, set the image size using width/height or pixels.
In this same tool pane, click the Export button to create the output file.
This worked for me, hope it helps someone else.
Providing the image you have created / have been working on is transparent in the first place, using the "Resize" or "Resample" tools in any major image editing package (e.g. PhotoShop, PaintShop Pro and so on) should not affect (or lose) the transparency at all.
I use PaintShop Pro (X6, 64 Bit) myself and typically find that the "PNG Optimizer" option offers more options along these lines (than the default "Save As > .png" route).
Hope that this helps (specific to PaintShop Pro Users) in relation to the source question.
While I was waiting for the downloads of other image editing softwares, I tried Microsoft Power Point and succeeded in preserving the transparency.
Drag the image inside any slide, crop or resize, then save as a new picture as .png.
You can drag the image back in ppt to confirm the transparency is maintained
The complete Autodesk Sketchbook is now out for free including all the previous premium features such as resizing an image.
You do it as you would in paint by clicking on Image > Image Size... and then you can save as a .png without losing transparency.
Image size can be reduced by reducing number of colors and there are online tools to do this .
Try these..Hope they solve your problem
https://tinypng.com/‎
http://pngcrush.com/ and
http://tools.dynamicdrive.com/imageoptimizer/ --It provides more output images with different number of colors. However, smoothness will be effected, take care.

Image Overlay With Coordinates

I recently have a project which invovles attempting to automatically "mock-up" images with a standard logo. For example, I have 1000 images of products, and I have one logo image that needs to be placed (over-layed) on top of each image. I know I can do this with ColdFusion's imageOverLay() function. However, I assume this always puts the overlayed image right in the middle of the underlying image (assuming they have the same width and height parameters). I was wondering if there was any way possible to specify and X/Y coordinate of the top-left corner of the overlaying image, and have the overlayed image placed in that location?
An example of a site:
http://www.internalsearch.expandedproductsearch.com/catalog/48/
You'll notice that all of the products have an image properly placed on the products. And I can assure you this wasn't done by hand. They must have a way to specifying where the overlaying image should go for each product, and then it just automatically puts the overlaying image (logo) in that spot. Can anyone think of any other way to do this? Is there some sort of advanced image library I could use with ColdFusion?
Any information would be greatly appreciated! Thank you.
I believe this got answered over on the Adobe forums and you are correct #Leigh; imagePaste was the solution.
I still can't comment on a question so posting this as an answer.

NSCursor images on a retina display

I am trying to modify the default I-beam cursor image. I'm using [[[NSCursor IBeamCursor] image] representations], passing each one through a CIFilter and adding it to a new image. However, the resulting cursor looks as though it is rendering the low-resolution images.
The High Resolution Guidelines say:
For custom cursors, you can pass a multirepresentation TIFF to the NSCursor class method initWithImage:hotSpot:.
So I would expect this to work. Additionally, if I get the -TIFFRepresentation of the original image and my modified image, and write them to disk, they both look like multi-page TIFF files with the same size images. What could I be doing wrong?
I have a somewhat-temporary solution: manually call -setSize: on each image representation, dividing the pixel height and width by the screen's scale factor. However, this technique doesn't seem like it will work ideally with multiple screens.
You're right on. I've been debugging this all day and I'm pretty sure I've got it nailed. I'm not doing exactly the same thing you are (my images are loaded from a file) but the end result is exactly the same.
The trick is to set the first representation of the multi-representation image to the non-retina size. If you are loading your cursors from an image file, you must take this extra step to adjust the size of the representations to match. It doesn't work 'out-of-the-box' as you would expect.
I've tested this on a machine with two monitors and dragging the window from the retina display to the non-retina display acts as it should, displaying the high/low resolution images for the cursor.
I had a similar problem a while ago: I had my cursor in a PDF, and it always drew as if it was a pixel image at 1:1 size, blown up. There's a solution to that in NSCursor: Using high-resolution cursors with cursor zoom (or retina).
Maybe someone can use that technique to solve this problem? My guess is creating an image with the same size but a different CTM marks it as the same size but Retina. What #jtbrandes is doing probably marks it as a different size and non-Retina. So you're effectively losing the scale factor information. If you create an image with a CTM in the hints, maybe you can draw the filtered images into it and it'll be detected right.

Setting Image Sizes In Windows Phone

Windows phone asks for specific image sizes when submitting an application. When I take the image I wanna use and resize it to the dimensiond they want it distorts the image. If I keep it proportional Ill never get the exact sizes they need. What do you guys do to resolve this?
I used Photoshop. Open the image, choose "Image" > "Canvas Size". That will adjust the size of the image without distorting it. I am sure you can also use any of the free image applications like gimp http://www.gimp.org/

crystal reports image squashed

Is there any way in Crystal Reports(v11, if this matters) to prevent the images from stretching itself to fit in the whole OLE-object? I'm loading the images dynamically from a database and don't know their aspect ratio.
Thanks for help.
i found the answer here
To make the image resize properly, you must perform the following steps in order:
Set the image's EnableCanGrow to true
Calculate and set Width and Height to the needed size
Set the image's EnableCanGrow to false
Fill the DataSet's image object with data
Continue with normal report processing.
If you get these items in the wrong order, or skip an item, you will
find that Crystal Reports scales the image in unexpected and unrecoverable ways.
The Crystal OLE object, which shows pictures from files, can only be set programmatically so for a 'pull' type report, where you are supplying a dynamic image name, of either portrait or landscape orientation, at least one of those orientations will get squashed to fit. It is better, IMHO, to show thumbnails and then have a calculated hyperlink to show the real picture in some decent viewer. You will spend an unreasonable amount of time trying to get the OLE object that shows pictures to understand that your image has a different aspect ratio. As long as it is at least reasonably legible that may have to suffice.
I don't think Crystal can help you. Try looking for some kind of command-line based app on the internet which can automically resize pictures (add black space, reduce in a 1:1 ratio, etc). I'm sure they're out there.

Resources