Export the raster copy at exactly the pixel dimensions of the HMI object that will display it, hold every line weight to two pixels or more, and place the object at the image's native size. A 640 x 480 overlay from a 10-inch drawing works out to 64 pixels per inch, so a 0.050 inch line renders about 3 pixels wide.
A simple line drawing of your production line makes a clean background for a machine status overlay: operators read the line exactly as they walk it, and indicator blocks sit on top of the equipment they report on. It is the classic shop-floor status board. The failure is predictable: the bitmap looks crisp in the HMI programming software, then arrives on the panel grainy, broken or stretched. The drawing is rarely the problem. The pixel math on the way in is: an export that does not match the overlay object's size, and line weights too thin to survive rasterization. Here is the workflow, the two numbers to compute, and a worked example at 640 x 480 pixels.
What you need
- The overlay object's target size in pixels, read from the HMI software's object properties: width and height. An overlay that fills a 640 x 480 working area needs a 640 x 480 file.
- The CAD drawing, simplified before export: hatching, dimensions and title-block graphics deleted, because detail that fine turns to noise at panel resolution.
- Every line weight in the drawing, listed so you can raise them in one pass.
- A pixel-level raster editor for the 100 percent zoom check.
The export target is the object's pixel size
An HMI panel puts every image pixel onto its own physical grid, and everything on an HMI screen is counted in pixels; that is why two panel sizes can share one layout. The export target is therefore a pair of numbers from the project, and the panel's screen size is only the special case where the overlay fills the whole working area. An overlay filling a 640 x 480 working area needs a 640 x 480 pixel file; an object sitting in a 400 x 300 corner needs a 400 x 300 pixel file.
Scaling the drawing to fit a 640 x 480 area inside CAD changes drawing units, and it leaves the pixel count of the exported file to the plot configuration or export dialog. Those are different operations, and only the second one sets pixels. Read the saved file's dimensions back from its properties and write them beside the object's dimensions before you import anything.
Create the raster at its final size
Two routes land the exact pixel count.
Plot from CAD. Create a paper size equal to the drawing, then pick the plot resolution so that paper width in inches times resolution in dots per inch equals the target pixel width: a 10 inch paper plotted at 64 dpi comes out 640 pixels wide. In AutoCAD the paper-size step lives in the plotter configuration: Device and Document Settings tab, Custom Paper Sizes, Add, then the width and height you need.
Rasterize in an editor. Set the editor's canvas to the exact pixel dimensions first, paste the CAD copy in, and position it at pixel level. There is no dpi rounding on this route, which makes it the sure one on small panels.
Either way, create the image at its final size and touch it no more. Saving a finished bitmap out at new pixel dimensions resamples the whole file: resampling sets the saved pixel dimensions, so edges soften and a thin line can lose a pixel on every pass.
Set line weight for the pixel grid
Two lines of arithmetic set every weight in the drawing:
- pixels per inch = export width in pixels / drawing width in inches
- line width in pixels = line weight in inches x pixels per inch
Hold every line to 2 pixels or wider. A one-color rasterizer decides pixel by pixel whether each pixel lies inside the line or beside it, and a line under about 2 pixels falls across the grid and comes out broken or missing. Gaps live under the same floor: a clear space under 2 pixels fills in.
Start from 0.050 inch because it clears that floor with room to spare at panel densities: it stays at 2 pixels or wider for any export at 40 pixels per inch or denser, which on a 640 pixel export means any drawing up to 16 inches across. Compute your own floor for your own scale.
When a real feature computes smaller than the floor, do not thin its neighbors to squeeze it in. Replace the detail with a color block or a callout label; the panel reads a label at any size.
If the export dialog offers edge smoothing or anti-aliasing, switch it off for a panel line drawing. Smoothing fills line edges with gray pixels, and gray halos read as blur at panel size. Pure black on pure white stays crisp.
Steps
- Read the overlay object's width and height in pixels from the HMI software's object properties and write both down.
- Simplify the CAD copy: delete hatching, dimensions and any text you plan to add later as real HMI objects, so the bitmap carries only the drawing itself.
- Compute pixels per inch: export width in pixels divided by drawing width in inches.
- Set every line weight to the 2 pixel floor or above: 2 divided by pixels per inch gives the minimum in drawing inches. Start from 0.050 inch and check the tightest gap against the same floor.
- Create the raster at the final size: a custom paper size plus a plot resolution that lands the pixel count, or a pixel-editor canvas set to the exact dimensions.
- Inspect the saved file at 100 percent zoom: finest line unbroken end to end, tightest gap open, corners square. Fix anything in CAD and re-export.
- Save the import copy lossless, BMP or PNG as the import dialog lists, and skip JPG for line drawings.
- Import the file, set the overlay object to the file's exact pixel dimensions, and leave the object's size handles alone from then on. Keep the status indicators as separate HMI objects sitting on top of the bitmap, so a state change never touches the drawing.
If the import step answers with a red X instead of a picture, the file format is the fault, and fixing an HMI bitmap import that shows a red X is a separate, shorter job.
Keep the file lean while you are in there: a black-on-white line drawing at 640 x 480 is small, but layered color exports grow fast, and bitmap memory on an HMI runs out sooner than the screen size suggests.
Example: a paint-line overlay at 640 x 480
Scenario: a paint line 40 ft long and 30 ft deep, drawn at 1 inch = 4 ft, shown as a full-screen overlay on a panel with a 640 x 480 working area.
- Drawing size: 40 ft at 1 inch = 4 ft is 10 in wide; 30 ft is 7.5 in tall.
- Export density: 640 px across 10 in is 64 px per inch. The height agrees: 480 px at 64 px per inch is 7.5 in.
- Line weights: the 2 px floor is 2 / 64 = 0.031 in. The 0.050 in trial renders 0.050 x 64 = 3.2 px, a solid line. A thin 0.25 mm hairline, about 0.010 in, renders 0.010 x 64 = 0.64 px, under one pixel, and breaks up.
- Gaps: two headers whose edges sit 0.050 in apart leave 3.2 px of clear space, the same as the line width, so lines and gap both survive. A 0.020 in gap is 1.28 px and closes up.
| Drawing value | At 64 px per inch | On the panel |
|---|---|---|
| 0.010 in hairline | 0.64 px | breaks up |
| 0.031 in weight | 2.0 px | the floor: stays solid |
| 0.050 in weight | 3.2 px | solid, comfortable |
| 0.050 in edge gap | 3.2 px | stays open |
| 0.020 in edge gap | 1.28 px | closes up |
Decision: plot this overlay at exactly 640 x 480 pixels, hold every line at 0.050 in, and turn any detail with less than 0.031 in of clear space into a callout label. Check the saved file at 100 percent zoom before it goes anywhere near the import dialog.
Check it on the panel
Transfer the project and judge the panel itself, first at normal viewing distance and then up close. The programming preview scales the image to fit its window, so it can look clean while the panel render is broken; the panel is the check that counts.
- The finest line runs unbroken from end to end.
- The tightest gap still has daylight between the lines.
- Corners are square, with no gray halo. A halo means smoothing stayed on at export or the panel is scaling the image.
- Nothing is cropped, and the proportions match the drawing.
- Every indicator sits on the equipment it reports.
If the panel shows fuzz but the editor at 100 percent was clean, put the file's pixel dimensions beside the object's dimensions in the project. A mismatch means the panel is scaling your image, so re-export at the object's size and leave the object at the image's native size.
If the image still looks wrong
Work the list in order; each item separates one cause from the next.
- Fuzz, banding or stray lines on every screen, including screens carrying no bitmap: the display hardware, and your file is innocent. Diagnosing lines on an industrial control display takes that fault on its own terms.
- Jagged or broken lines only on the overlay: recompute pixels per inch and hold every line to the 2 px floor, then re-export. A weight that was correct at one export size is wrong at another.
- Stretched or squashed proportions: the object was dragged to a size the image does not have. Reset the object to the file's exact pixel dimensions.
- Soft gray edges on every line: smoothing was on at export. Switch it off and export again.
Recommendation: Export the overlay at exactly the pixel dimensions of the object that displays it, hold every line weight to 2 pixels or more at that density (0.050 inch clears the floor whenever the export runs at 40 pixels per inch or denser, which covers a 640 pixel export of any drawing up to 16 inches wide), judge the saved file at 100 percent zoom, and re-export a fresh file whenever the object size changes instead of resizing the image.
Questions
Should I export the drawing as a JPG to keep the file small?
No. JPG compression averages blocks of neighboring pixels and leaves faint ringing along black edges, which reads as extra grain at panel size. Export a lossless copy: BMP works on most operator panels, and PNG wherever the import dialog lists it. Keep the drawing pure black on white so the export creates no gray edge pixels. At 640 x 480 a line drawing is small even uncompressed, so compression saves nothing worth having.
Does the same math hold on a 320 x 240 panel?
Yes, with your own two numbers. Pixels per inch equals the export width in pixels divided by the drawing width in inches. A 320 pixel wide export of the same 10 inch drawing works out to 32 pixels per inch, so the 2 pixel floor rises to 0.0625 inch of line weight (2 divided by 32), and a 0.050 inch line would render only 1.6 pixels wide and break up. Use about 0.070 inch there, which gives 2.24 pixels.
What plot resolution should I pick in the CAD export?
Pick the resolution whose product with the paper width equals the target pixel width: paper width in inches times dots per inch gives the file's pixel count. A 10 inch paper at 64 dpi plots 640 pixels across. If the plotter configuration offers only fixed steps, take the step just above the target, plot, and bring the file down to the exact pixel count once in the pixel editor. One downsize onto the exact target is a single, planned resample; the damage comes from resizing again and again.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.